UNION

The UNION command combines the result set of two or more SELECT statements (only distinct values).

UNION ALL

The UNION ALL command combines the result set of two or more SELECT statements (allows duplicate values).

SELECT City FROM Customers
UNION
SELECT City FROM Suppliers
ORDER BY City;
SELECT City FROM Customers
UNION ALL
SELECT City FROM Suppliers
ORDER BY City;
Last modified: November 2, 2020

Author

Comments

Write a Reply or Comment