I am trying to build a select query that will essentially left join two tables and display one column from each table as a single column.
the table structure is similar to:
table a:
id, email
table b:
id, tablea_id, email
I am trying to get a single column of email and email (with no dupes or nulls ideally).
ideal results would be:
one@one.com
two@two.com
three@three.com
and the email address that is returned could be from either a or b.
Maybe a union is what would work best, but I not able to figure out how to do a union on the second table based on the id of the first table.
When searching for a solution, perhaps my wording is bad, but I can’t find any examples.
thanks for any help.
It seems that you want something on the lines of this: