Combining Queries

SELECT Name, Population, SurfaceArea 
FROM country
WHERE Population > 200000000

UNION

SELECT Name, Population, SurfaceArea  
FROM country
WHERE SurfaceArea > 9000000


Name Population SurfaceArea
China 1,277,558,000 9,572,900.00
Indonesia 212,107,000 1,904,569.00
India 1,013,662,000 3,287,263.00
United States 278,357,000 9,363,520.00
Antarctica 0 13,120,000.00
Canada 31,147,000 9,970,610.00
Russian Federation 146,934,000 17,075,400.00

The statement contains two SELECT statements separated by the UNION keyword. The number and types of fields in both statements are the same. UNION instructs the DBMS to execute both SELECT statements and combine the output into a single query result set.

The UNION automatically removes any duplicate rows from the query result set.