Subject | Outer Join |
---|---|
Author | Ed Dressel |
Post date | 2003-11-07T21:21:27Z |
I have a master/detail relationship with there being one master table
and 2 detail tables. Only one of the 2 detail tables can have a
record matching the master--there may be done. I wanted to find out
which one did not. I created this query
Select Master.Master_ID,
Detail1.Master_ID,
Detail2.Master_ID,
from Master left join Detail2 on
(Master.Master_ID = Detail2.Master_ID),
Master left join Detail1 on
(Master.Master_ID = Detail1.Master_ID)
I wanted a list of every record in the master, and the 2nd column
value being not null if it existed in Detail1 and likewise for
Detail2's column--but I didn't achive this--I got a whole lot more
records then I wanted.
How can I achieve this?
Thanks
Ed Dressel
and 2 detail tables. Only one of the 2 detail tables can have a
record matching the master--there may be done. I wanted to find out
which one did not. I created this query
Select Master.Master_ID,
Detail1.Master_ID,
Detail2.Master_ID,
from Master left join Detail2 on
(Master.Master_ID = Detail2.Master_ID),
Master left join Detail1 on
(Master.Master_ID = Detail1.Master_ID)
I wanted a list of every record in the master, and the 2nd column
value being not null if it existed in Detail1 and likewise for
Detail2's column--but I didn't achive this--I got a whole lot more
records then I wanted.
How can I achieve this?
Thanks
Ed Dressel