intermediateSet Operators — UNION, INTERSECT, EXCEPT/MINUS

What does A EXCEPT B return, and why does argument order matter?

It returns rows present in A but not in B. Order matters because EXCEPT is not symmetric — B EXCEPT A answers a completely different question (rows in B but not in A), so swapping the operands is a silent logic bug, not something that throws an error.

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full Databases Mastery library.

What does A EXCEPT B return, and why does argument order matter?

Next Step

Continue to What requirement must both queries satisfy before you can combine them with a set operator?← Back to all SQL questions