kymbrik
12/14/2017 - 2:06 PM

SQL: Distinct values from two tables

The answer - UNION two SQL queries:

SELECT email FROM registration
UNION
SELECT email FROM newsletter



UNION will remove all the duplicates for you. If you wanted to show the duplicates as well, you would use UNION ALL.