Dear group!
The following statement gives me a resultset containing two columns
containing a PersonID:
SELECT *
FROM A
LEFT JOIN B ON A.PersonID=B.PersonID
UNION SELECT *
FROM A
RIGHT JOIN B ON A.PersonID=B.PersonID;
How can I change this statement to get only one PersonID that covers
the PersonIDs from A and B? I need this combined PersonID because I
have to combine that union with some more tables like this...
SELECT *
FROM D
LEFT JOIN Union_01 ON D.PersonID=Union_01.PersonID
UNION SELECT *
FROM D
RIGHT JOIN Union_01 ON D.PersonID=Union_01.PersonID;
And that only works with one PersonID, otherwise Access complains -
rightly!
Originally I wanted to combine five tables, also covering all
PersonIDs that only appear in some, but not in all tables, but I did
not find a way using Access (2003) - anyone got an idea?
SELECT A.*, B.*, D.*, R.*, T.*
FROM (((A INNER JOIN B ON A.Personen_ID=B.Personen_ID) INNER JOIN D ON
B.Personen_ID=D.Personen_ID) INNER JOIN R ON
D.Personen_ID=R.Personen_ID) INNER JOIN T ON
R.Personen_ID=T.Personen_ID
ORDER BY A.Personen_ID;
This is nice, but skips the mentioned entries where a Person_ID e.g.
only appears in table D :-(
Thank you very much!
With kind regrads,
Chriss
P.S: Originally, I had five Excel-Tables I wanted to combine... *sigh*