Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> SQL Outer Join Problem
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:08:31 CDT