bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

SQL UNION Keyword

Union

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

The following SQL statement returns the cities (only distinct values) from both the "Customers" and the "Suppliers" table:

Example

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

Previous

SQL DROP TABLE and TRUNCATE TABLE Keywords

Next

SQL UNION ALL Keyword