September 10th, 2012, 10:58 PM
Join tables and getting records even no data on other table?
Hi. I know how to do a left join but let's say I've a table A and table B.
They have member_id field on both table then let's say I've education on table A and then member's interest.
But sometime some members will have education and no interest or have interest but no education info on the tables.
So doing a left join A to B or B to A then I will sometime missed some records.
I don't want to use the master table members then left join table A and left join B because members table is too big. Please answer my question instead of saying something else, etc.
Is there a way to join table A and B or other way so I can get the records of A and B even there may not be data on either one for some members?
Hope you know what I mean and can help me. Thank you.
September 10th, 2012, 11:15 PM
what you want is a FULL OUTER JOIN, but unfortunately, mysql doesn't support it
so you will have to do a LEFT OUTER JOIN with a UNION (not UNION ALL) of a RIGHT OUTER JOIN
September 11th, 2012, 03:56 AM
I was going to say something else, but wasn't allowed.