Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL and outer joins

Re: SQL and outer joins

From: MWeb <jasonh_at_yebo.co.za>
Date: Mon, 12 Jul 1999 23:51:35 +0200
Message-ID: <378a648a.0@news1.mweb.co.za>


try changing

AND B.NAME_TYPE = 'GR' to

AND (B.NAME_TYPE = 'GR' OR B.NAME_TYPE IS NULL) Regards,
Jason

Paul Ferrie <daspaf_at_julian.uwo.ca> wrote in message news:378A55C0.ACFB3177_at_julian.uwo.ca...
> Can anyone tell me how to accomplish this....
>
> I have 2 tables DONOR_TBL and NAME_TBL.
>
> I have both Active and Inactive donors. There are multiple names for
> donors based on a Name Type Code. I need a list of all Active donors
> where the Name Type is 'GR'. The problem is, I still want to see all
> the Active donors even if they don't have a Name Type of 'GR'.
>
> So, if I were to do the following:
>
> SELECT A.DONOR_NUMBER, B.DONOR_NAME
> FROM DONOR_TBL A, NAME_TBL B
> WHERE A.DONOR_NUMBER = B.DONOR_NUMBER(+) AND
> A.DONOR_STATUS = 'A' AND
> B.NAME_TYPE = 'GR'
>
> the outer join is negated by the other WHERE criteria. So, do I have to
> do a UNION or is there another way around this?
>
> Thanks in advance.
>
> Paul.
>
Received on Mon Jul 12 1999 - 16:51:35 CDT

Original text of this message

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