Combine SQL Queries With UNION, INTERSECT, EXCEPT

Опубликовано: 26 Февраль 2026
на канале: Becoming a Data Scientist
57,348
1.4k

Step-by-step tutorial shows you how to combine your SQL queries (columns) with UNION, INTERSECT, and EXCEPT!

Queries:
1) Get the combined unique values in 2 columns: SELECT column FROM table1 UNION SELECT column FROM table 2
2) Get the unique values that are present in 2 columns: SELECT column FROM table1 INTERSECT SELECT column FROM table 2
3) Get the values that aren't present in 2 columns: SELECT column FROM table 1 EXCEPT SELECT column FROM table 2

Get the Northwind Database:    • How to Load a Sample PostgreSQL Database i...  

Support the Channel:
1) Subscribe:
2) DataCamp:
3) Udacity: