EXCEPT

Applies to: sql

EXCEPT returns rows from the first query that do not appear in the second query.

SELECT user_id FROM users
EXCEPT
SELECT user_id FROM orders;

See also: union, intersect