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

Re: Conditional Join

From: Peter <peternybor_at_gmail.com>
Date: Thu, 22 Nov 2007 01:22:59 -0800 (PST)
Message-ID: <724b26b5-5f6e-4461-b0cd-c89c1c04d337@s19g2000prg.googlegroups.com>


I think your outer join logic was wrong. Your ANSI join syntax example should be:

SELECT ...
  FROM mascustomer a RIGHT OUTER JOIN mascustaddr b

       ON (a.customerid = b.customerid) AND (b.activeyn = 'Y')

Your Oracle join syntax example should be:

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

NitsR wrote:
> Hi John
>
> thanks for the reply
> I am using 10g
>
> I changed my query as per your suggestion as follows
>
> SELECT a.customercode, a.custname, b.custaddr
> FROM mascustomer a RIGHT OUTER JOIN mascustaddr b
> ON (a.customerid = b.customerid)
> WHERE (b.activeyn = 'Y')
>
> Still the same result, only matching records are returned.
Received on Thu Nov 22 2007 - 03:22:59 CST

Original text of this message

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