Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL and outer joins
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
![]() |
![]() |