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 -> SQL Outer Join Problem

SQL Outer Join Problem

From: Mike DiChiappari <mike_at_mysticsoft.com>
Date: 31 Aug 2000 12:08:31 GMT
Message-ID: <8olhrv$ed1@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:08:31 CDT

Original text of this message

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