View Single Post

   
  #2 (permalink)  
Old 05-10-2008, 03:12 PM
Plamen Ratchev
 
Posts: n/a
Default Re: SQL Select All Items where one meets the criteria

Here is one way:

SELECT P.people_code_id, G.giving_amount, G.fiscal_year
FROM People AS P
JOIN GivingSummary AS G
ON P.people_code_id = G.people_org_code_id
WHERE EXISTS (SELECT *
FROM GivingSummary AS G2
WHERE G2.people_org_code_id = G.people_org_code_id
AND G2.giving_amount >= 500
AND G2.fiscal_year <> '');


HTH,

Plamen Ratchev
http://www.SQLStudio.com
Reply With Quote