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 -> Conditional Join

Conditional Join

From: NitsR <nitinvraj_at_gmail.com>
Date: Wed, 21 Nov 2007 18:40:34 -0800 (PST)
Message-ID: <3a12f51b-d41c-4fb2-a72e-e90503526bd3@e6g2000prf.googlegroups.com>


Hello All

I have a Customer Master table and have a child table for multiple address of 1 customer. In the Address table have a column for ActiveYN which is 'Y' for only one record. I want to get a view with the ActiveYN = 'Y' address by joining these 2 tables. And also need a outer join so even if there is no address for the customer then it will still get the customer master record

I tried this

Select a.CustomerCode,a.CustomerName,b.CustAddress From CustMast a, CustAddrMast b
where Custmast.CustomerId = custaddrmast.CustomerId(+) and Customeraddrmast.ActiveYN = 'Y';

but this results only in the matching records.

Any help ?
Thanks. Received on Wed Nov 21 2007 - 20:40:34 CST

Original text of this message

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