Combine rows from multiple queries: UNION, INTERSECT, EXCEPT/MINUS.
Combine results from multiple queries: UNION stacks and deduplicates, INTERSECT keeps only common rows, EXCEPT keeps rows from the first query not in the second. Each has ALL variants that skip deduplication. Essential for set logic in data analysis.
| Database System | Support Status | Since Version | Notes |
|---|---|---|---|
| MySQL | ✓ Supported | all | No INTERSECT/EXCEPT (emulate) |
| PostgreSQL | ✓ Supported | all | Full SET support |
| SQL Server | ✓ Supported | 2005 | EXCEPT supported |
| Oracle | ✓ Supported | all | MINUS instead of EXCEPT |
| SQLite | ✓ Supported | all | INTERSECT/EXCEPT since 3.15 |
Combine result-sets by set logic.
No INTERSECT/EXCEPT (emulate)
Full SET support
EXCEPT supported
MINUS instead of EXCEPT
INTERSECT/EXCEPT since 3.15