Skip to content

Instantly share code, notes, and snippets.

@mcculley
Last active September 20, 2020 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcculley/0ad5c353b912431d5f7d4175e189cf14 to your computer and use it in GitHub Desktop.
Save mcculley/0ad5c353b912431d5f7d4175e189cf14 to your computer and use it in GitHub Desktop.
; Find the top ten PACs by total contributions from individuals with no employer listed.
select b.cmte_nm as committee_name, a.committee_ID, a.total_contribution
from (select individual_contribution."CMTE_ID" as committee_ID, sum(individual_contribution."TRANSACTION_AMT")
as total_contribution from individual_contribution
where "ENTITY_TP"='IND' and ("EMPLOYER" in ('NONE', 'UNEMPLOYED', 'NOT EMPLOYED', 'N/A', 'NO EMPLOYER', 'NONE GIVEN')
or "EMPLOYER" is null) group by individual_contribution."CMTE_ID")
as a join committee
as b on a.committee_ID = b.cmte_id
order by total_contribution desc;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment