Union & Join
Last updated
Was this helpful?
Last updated
Was this helpful?
The UNION
operator is used to combine the result-set of two or more SELECT
statements.
Every SELECT
statement within UNION
must have the same number of columns
The columns must also have similar data types
The UNION ALL
can include the duplicated value
Only return the result matched to the condition
Return all the result of left table and right table matched to the condition
Return all the result of right table and left table matched to the condition
Return all the result of left table and right table
Subquery can express sql query in logical order and easier to understand
Join execution time and performance is better