Union operator

suggest change

The UNION operator is used to combine the result-set (only distinct values) of two or more SELECT statements.

Query: (To select the distinct cities from the “Customers” and “Suppliers” tables)

SELECT City FROM Customers
UNION
SELECT City FROM Suppliers
ORDER BY City;

Result:

Number of Records: 11

City
------
Aachen
Albuquerque
Anchorage
Ann Arbor
Annecy
Barcelona
Barquisimeto
Bend
Bergamo
Berlin
Bern

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents