UNION ALL With WHERE

suggest change

UNION ALL to select all(duplicate values also) German cities from the “Customers” and “Suppliers” tables. Here Country="Germany" is to be specified in the where clause.

Query:

SELECT City, Country FROM Customers
WHERE Country='Germany'
UNION ALL
SELECT City, Country FROM Suppliers
WHERE Country='Germany'
ORDER BY City;

Result:

Number of Records: 14

City Country
Aachen Germany
Berlin Germany
Berlin Germany
Brandenburg Germany
Cunewalde Germany
Cuxhaven Germany
Frankfurt Germany
Frankfurt a.M. Germany
Köln Germany
Leipzig Germany
Mannheim Germany
München Germany
Münster Germany
Stuttgart Germany

Feedback about page:

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



Table Of Contents