1
SQLIntermediate#indexes#performance
INTERSECT returns rows present in both queries; EXCEPT (MINUS in Oracle) returns rows in the first query that are not in the second. Both remove duplicates.
SELECT id FROM active_users INTERSECT SELECT id FROM paying_users; SELECT id FROM all_users EXCEPT SELECT id FROM banned_users;