Re: Outer Joins for more than 2 tables ???

From: Philip Hall 283-4031 <hall_at_orion.NoSubdomain.NoDomain>
Date: 17 Mar 1992 22:27:25 GMT
Message-ID: <1992Mar17.222725.7599_at_aio.jsc.nasa.gov>


In article <fragante.700446630_at_chilko.ucs.ubc.ca>, fragante_at_unixg.ubc.ca (Gv Fragante) writes:
|> Can anyone give me some ideas how I can perform an Outer Join on more than 2
|> tables ?
|>
|> For example, I have Tables A, B, C, D. Table A is a "master" table, while
|> the rest are "detail" tables.
|>
|> I'd like to do a query against these 4 tables listing all the values in the
|> "master" table that may or may not be in the "detail" tables.
|>
|> Is this possible ? Thanks.

If I understand your problem correctly, the following works:

Select A.colA1, A.colA2, B.colB2, C.colC2, D.colD2
where A.colA1 = B.colB1(+)
  and A.colA1 = C.colC1(+)
  and A.colA1 = D.colD2(+)

This returns all values of colA1 and colA2 regardless of whether matching rows are found in B,C & D.

Philip Hall Received on Tue Mar 17 1992 - 23:27:25 CET

Original text of this message