| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Outer Join Problem
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...Received on Thu Aug 31 2000 - 07:22:47 CDT
> 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
>
>
>
![]() |
![]() |