Approved Workman Database

Community Contributions => SQL Workbench => Topic started by: Eric Berry on April 03, 2012, 11:25:07 AM

Title: Determining particpant awards
Post by: Eric Berry on April 03, 2012, 11:25:07 AM
Can someone give me a SQL command where I can find the active clubbers who are not receiving a book award at the end of the year sorted by club and last name?

We want to give them participation certificates.
Title: Re: Determining particpant awards
Post by: Eric Berry on April 03, 2012, 11:54:43 PM
select p.filing_name, r.club_name from person p, role r where r.role_name='Clubber' and p.status='Active' and p.person_id=r.person_id and p.filing_name not in (select p.filing_name from Person p, Award a where a.person_id=p.person_id and a.award_source='Book' and a.Club_year='2011-2012' and a.award_name<>'Sparks Membership Card') order by r.club_name, p.filing_name