Union
This lesson demonstrates how to combine results from several queries.
We'll cover the following...
We'll cover the following...
Union
The UNION clause allows us to combine the results from several queries together. The clause doesn’t join the table but merely clubs the two results together.
Syntax
<Query1>
UNION
<Query2>
Connect to the terminal below by clicking in the widget. Once connected, the command line prompt will show up. Enter or copy and paste the command ./DataJek/Lessons/27lesson.sh and wait for the MySQL prompt to start-up.
-
As a contrived example, we’ll write a query that prints all the first names from the Actors table and all the URLs from the DigitalAssets table.
SELECT FirstName FROM