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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Help with join

Re: Help with join

From: Stephan Born <stephan.born_at_beusen.de>
Date: 2000/05/18
Message-ID: <3923BC2D.3C2458CC@beusen.de>#1/1

>
> What I tried was:
> select *
> from
> emp, boss,
> location l1,
> location l2
> where
> emp.loc = l1.loc and
> emp.boss = boss.name(+) and
> boss.loc = l2.loc
>
> Unfortunately, that last join is the killer. If
> emp.boss is null, then boss.loc is null and
> boss.loc = l2.loc doesn't match anything. The
> best I could come up with was a kludge using a
> default location like this:
>

select *
from

      emp, boss,
      location l1,
      location l2
where
      emp.loc = l1.loc and
      emp.boss = boss.name(+) and
      boss.loc = l2.loc (+)

If you outer-join a table and you have to join other tables to this outer-joined table,
you should outer-join these tables, too.

Regards, Stephan

--
---------------------------------------------------------------
Dipl.-Inf. (FH) Stephan Born   | beusen Consulting GmbH
fon: +49 30 549932-0           | Landsberger Allee 392
fax: +49 30 549932-21          | 12681 Berlin
mailto:stephan.born_at_beusen.de  | Germany
---------------------------------------------------------------
       PGP-Key verfügbar       |      PGP-Key available
---------------------------------------------------------------
Received on Thu May 18 2000 - 00:00:00 CDT

Original text of this message

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