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 -> SQL and outer joins

SQL and outer joins

From: Paul Ferrie <daspaf_at_julian.uwo.ca>
Date: Mon, 12 Jul 1999 16:53:20 -0400
Message-ID: <378A55C0.ACFB3177@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 - 15:53:20 CDT

Original text of this message

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