Problem Statement
Which SQL pattern accurately returns rows in A that have no match in B?
Explanation
The anti-join pattern uses a left join and then filters for rows where the right side is missing. This expresses “in A but not in B”.
The same logic can be written with NOT EXISTS. Choose the form that is clearest and performs well in your engine.
Code Solution
SolutionRead Only
SELECT A.* FROM A LEFT JOIN B ON B.k = A.k WHERE B.k IS NULL;
