Skip to content

Instantly share code, notes, and snippets.

@andmcgregor
Created June 18, 2013 02:40
Show Gist options
  • Save andmcgregor/5802272 to your computer and use it in GitHub Desktop.
Save andmcgregor/5802272 to your computer and use it in GitHub Desktop.
DELETE FROM voters
WHERE homeowner = 1
AND employed = 1
AND children_count = 0
AND party_duration < 3
AND (SELECT voters.id
FROM voters
INNER JOIN votes
ON voters.id = votes.voter_id
INNER JOIN congress_members
ON votes.politician_id = congress_members.id
GROUP BY votes.politician_id
HAVING congress_members.grade_current > 12) >= 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment