MySQL Join Where Not Exists

I’d probably use a LEFT JOIN, which will return rows even if there’s no match, and then you can select only the rows with no match by checking for NULLs.

So, something like:

FROM voter V LEFT JOIN elimination E ON = E.voter_id
WHERE E.voter_id IS NULL

Whether that’s more or less efficient than using a subquery depends on optimization, indexes, whether its possible to have more than one elimination per voter, etc.

Leave a Comment