Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Outer join two tables with two keys

pjsiong-JavaNetMar 30 2011 — edited Apr 1 2011
Hi,
I have a question regard outer join,

I have table A (Aid, ADesc), Table B(Bid, Bdesc), and Table C (Aid, Bid, Cdesc)
There is data in Table A and B, but Table C is empty
I want to outer join C with A and B with below query

select ADesc,Bdesc, Cdest
from A, B, C
where A.Aid=C.Aid(+) and B.Bid(+)=C.Bid
and A.Aid='XXX' and B.Bid(+)='ZZZ'

The query result show only data in column Adesc , but column BDesc is empty even though there are some data in table B.

How should the query been modified to correctly show ADESC and Bdesc.

Thanks

Vincent
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 29 2011
Added on Mar 30 2011
11 comments
1,486 views