MySQL: select emails from one table only if not in another table?

mysql

Solution

Try

SELECT Email.address
FROM Email LEFT OUTER JOIN DoNotMail on Email.address = DoNotMail.address
WHERE DoNotMail.address is null

It avoids needing a subquery.

Problem

I am going to build a table called donotemail that will contain the email addresses of people who ask to be removed from our email list. I have another table called users with an email column. How can I select all the emails from users but only if the email address is not in the donotemail table? Thanks!

Original source