I'm not even sure if this is possible, but I have two tables containing email addresses, some of which are common to both tables.
Is there a way I can extract a merged set of addresses from both tables in one go?
What I have so far is: SELECT tbl1.email AS email1, tbl2.email AS email2 SELECT IF(tbl1.email IS NOT NULL, tbl1.email, tbl2.email) as email FROM tbl1 LEFT JOIN tbl2 USING (email)
.. which will get me all the addresses from tbl1, with the matching address from tbl2 in email2 or NULL if there is no match.
What I want is to also get all the addresses in tbl2, with NULL against email1 where there is no match. That is what I thought an OUTER join did but it seems I'm wrong.
(Once I have a set of results containing 2 fields, where every address in each table appears, I can easily merge the two fields using an IF.)