I have a whole bunch of tables:
Table1: PersonID, A1, A2, A3, ...
Table2: PersonID, B1, B2, B3, ...
Table3: PersonID, C1, C2, C3, ...
Table4: PersonID, D1, D2, D3, ...
...
Table1 is special as it does in fact contain all individuals (names and personal information) but all other tables are almost certainly missing rows (a person simply did not participate in that event).
What I would like to do is join all the tables together (by the common PersonID) such that any missing attributes will simply be left blank. So, of course, I thought to use outer joins. This is what I tried:
SELECT *
FROM Table1, Table2, Table3, Table4, Table5, Table6
LEFT OUTER JOIN Table2 ON Table1.PersonID = Table2.PersonID
LEFT OUTER JOIN Table3 ON Table1.PersonID = Table3.PersonID
LEFT OUTER JOIN Table4 ON Table1.PersonID = Table4.PersonID
LEFT OUTER JOIN Table5 ON Table1.PersonID = Table5.PersonID
LEFT OUTER JOIN Table6 ON Table1.PersonID = Table6.PersonID
All this does is give me a memory overload. I think I'm somehow taking the Cartesian product of all my tables and it's choking everything up. Is there a good way to do this?
Thanks in advance!