Skip to content

Instantly share code, notes, and snippets.

@debreczeni
Created July 25, 2011 15:51
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 debreczeni/1104437 to your computer and use it in GitHub Desktop.
Save debreczeni/1104437 to your computer and use it in GitHub Desktop.
SELECT `people`.* FROM `people` WHERE `people`.`deleted_at` IS NULL AND (`people`.`country_id` = 16777217) AND (id IN (SELECT DISTINCT person_id FROM people_sections WHERE people_sections.deleted_at IS NULL AND section_id IN (SELECT DISTINCT section_id FROM event_types WHERE event_types.deleted_at IS NULL AND event_types.id IN (SELECT DISTINCT event_type_id FROM events WHERE events.deleted_at IS NULL AND competition_id = 16777237)))) AND ((people.lastname LIKE '%gabriella%' or people.firstname LIKE '%gabriella%')) AND ((people.lastname LIKE '%szabo%' or people.firstname LIKE '%szabo%')) LIMIT 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment