EXCEPT is a set operator that returns rows from the first SELECT statement that do NOT appear in the second SELECT statement.
Key points:
- Think of it as A − B (set difference)
- Automatically removes duplicates
Both queries must return:
- Same number of columns
- Compatible data types
- Same column order
