Find unmatched left-side rows by checking for `NULL` on the right.
Section: Common join patterns
Left join to find users without subscriptions
sql
sql
SELECT u.user_id, u.email
FROM users u
LEFT JOIN subscriptions s ON s.user_id = u.user_id
WHERE s.user_id IS NULL;Explanation
This is a classic anti-join pattern for missing relationships.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Common join patterns
Inner join active users with subscriptions
Only users who have a matching subscription row appear.
Full outer join to compare two datasets
See items present in one side, the other side, or both.
Emulate FULL OUTER JOIN where unsupported
Use a `LEFT JOIN` + unmatched rows from the other side via `UNION ALL`.