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

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Outer Join Problem

Re: SQL Outer Join Problem

From: Valentin Mînzatu <mvali_at_rds.ro>
Date: Thu, 31 Aug 2000 12:22:47 GMT
Message-ID: <r6sr5.105$bo5.3590@nreader1.kpnqwest.net>

In your query you have three tables joined, but the outer join refers only two of them.
Try this:

SELECT *
  FROM etable, otable, utable
WHERE etable.oid = otable.id (+)

     AND otable.uid = utable.id (+)

--
Vali


Mike DiChiappari <mike_at_mysticsoft.com> wrote in message
news:8olhrv$ed1_at_dispatch.concentric.net...

> Hello,
>
> I am having trouble with a query that involves using an outer join.
>
> I have three tables: etable, utable, and otable. There are relationships
> between etable<->otable and otable<->utable. I would like to do an outer
> join between etable and otable so that all records in etable are returned,
> even when a NULL exists in etable's foreign key into otable. So far this
is
> easy:
>
> SELECT * FROM etable, otable WHERE etable.oid = otable.id (+) AND ...
>
> However, in the case where etable.oid is not NULL I would like to do a
join
> between otable and utable. Note that the following doesn't work (or make
> sense really).
>
> SELECT * FROM etable, otable, utable WHERE etable.oid = otable.id (+)
AND
> otable.uid = utable.id
>
> Is there a way to do this?
>
> Thanks,
> Mike
>
>
>
Received on Thu Aug 31 2000 - 07:22:47 CDT

Original text of this message

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