What do INTERSECT and EXCEPT do?

SQL subqueries, CTEs and set operations · Freshers and experienced

Model answer

INTERSECT returns rows that appear in both queries. EXCEPT (MINUS in Oracle) returns rows from the first query that do not appear in the second. Like UNION, both need matching column counts and types, and both remove duplicates by default.

Learn this topic

Subqueries, EXISTS and CTEs: Queries Inside Queries in the course SQL for Beginners: Learn Databases Step by Step.

Sign in to add your own answer.

More questions