Pacific-Design.com

    
Home Index

1. SQL Language

2. 06 UNION

SQL Language / 06 UNION /

SQL - UNION

SQL returns unique cities from Customers and Suppliers in Germany.
SELECT city FROM Customer WHERE country='Germany'
UNION
SELECT city FROM Supplier WHERE country='Germany'
ORDER BY city;


SQL - UNION ALL

SQL returns all and duplicate cities from Customers and Suppliers in Germany.
SELECT city FROM Customer WHERE country='Germany'
UNION ALL
SELECT city FROM Supplier WHERE country='Germany'
ORDER BY city;