What is the difference between the SQL keywords union
and join
?
The UNION
operator is used to combine the result-set of two or more SELECT
statements.
The JOIN
keyword is used in an SQL statement to query data from two or more tables, based on a relationship between certain columns in these tables.
The tutorials on these two topics (linked to above) on w3schools.com go into further detail.
Think of joins as horizontal and unions as vertical
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With