Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.oracle -> Re: Some SQL Help Please

Re: Some SQL Help Please

From: Jack <admin_at_stirlingonline.com>
Date: 17 Jun 2004 22:25:13 -0700
Message-ID: <7a80a637.0406172125.1ece3b7e@posting.google.com>


Hi Charlie;

You'll have to use the old fashioned outer join syntax.

This consists of adding the characters "(+)" onto the column(s) in your WHERE clause which refer to the 'optional' tables. By 'optional' I mean the tables that might or might not have matching rows.

This would change your WHERE clause from:

>
> WHERE A.key = B.key AND C.key = B.key AND D.key = C.key
> AND E.key = D.key AND F.KEY = E.key AND H.key = E.key
> AND G.key = H.key AND I.key = H.key;
>

to:
>
> WHERE A.key = B.key AND C.key = B.key AND D.key = C.key
> AND E.key = D.key AND F.KEY = E.key AND H.key = E.key
> AND G.key(+) = H.key AND I.key(+) = H.key;

Cheers, have fun tuning it!

Jack Received on Fri Jun 18 2004 - 00:25:13 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US