Skip to content

Instantly share code, notes, and snippets.

@mattbeedle
Created November 4, 2009 13:55
Show Gist options
  • Save mattbeedle/226060 to your computer and use it in GitHub Desktop.
Save mattbeedle/226060 to your computer and use it in GitHub Desktop.
SELECT id FROM "boards" WHERE ((("boards"."visible" = 't')) AND ("boards"."id" IN (323,429,597,361,534,360,407,404,232,383,535,584,395,410,583,394,363,527,210,183,362,598,595,523))) ORDER BY targeted_on_occupations DESC LIMIT 10 OFFSET 0
=> 534, 584, 527, 429, 323, 523, 394, 583, 232, 595
SELECT id FROM "boards" WHERE ((("boards"."visible" = 't')) AND ("boards"."id" IN (323,429,597,361,534,360,407,404,232,383,535,584,395,410,583,394,363,527,210,183,362,598,595,523))) ORDER BY targeted_on_occupations DESC LIMIT 10 OFFSET 20
=> 597, 595
SELECT boards.id FROM "boards" LEFT OUTER JOIN taggings boards_taggings ON boards_taggings.taggable_id = boards.id AND boards_taggings.taggable_type = E'Board' LEFT OUTER JOIN tags boards_tags ON boards_tags.id = boards_taggings.tag_id WHERE ((boards_taggings.context = E'occupations' AND boards_tags.name IN (E'Direct Marketing (CRM)')) OR (boards_taggings.context = E'occupations' AND boards_tags.name IN (E'Brand/Product Marketing')) OR (boards_taggings.context = E'occupations' AND boards_tags.name IN (E'Visual/Display Merchandising')) OR (boards_taggings.context = E'seniorities' AND boards_tags.name IN (E'Student')) OR (boards_taggings.context = E'regions' AND boards_tags.name IN (E'1')) OR (boards_taggings.context = E'classifications' AND boards_tags.name IN (E'Internship')) OR (boards_taggings.context = E'schedules' AND boards_tags.name IN (E'Full Time'))) GROUP BY boards.id HAVING COUNT(*) >= 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment