Created
November 8, 2012 16:58
-
-
Save moxie/4040062 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Returns only FL for desired_work_location | |
SELECT GROUP_CONCAT(resume_locations.location_state) as desired_work_locations | |
FROM `resumes` | |
LEFT JOIN `resume_locations` ON `resume_locations`.`resume_id` = `resumes`.`id` | |
WHERE (resume_locations.location_state = 'FL') | |
GROUP BY resumes.id | |
-- Returns FL,NY,AZ,NH for desired_work_locations | |
SELECT GROUP_CONCAT(resume_locations.location_state) as desired_work_locations | |
FROM `resumes` | |
LEFT JOIN `resume_locations` ON `resume_locations`.`resume_id` = `resumes`.`id` | |
GROUP BY resumes.id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment