SQL 41 🛢️ Result Set Intersection with INTERSECT
Two queries. Two result sets. You need the rows that appear in both. This is set intersection, and SQL provides a dedicated operator for it: INTERSECT. It is one of the three set operators in standard SQL, alongside UNION and EXCEPT. Where UNION combines results and EXCEPT subtracts one from another, INTERSECT returns only the…