Skip to content

Instantly share code, notes, and snippets.

@felclef
Created August 15, 2011 16:47
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 felclef/1147170 to your computer and use it in GitHub Desktop.
Save felclef/1147170 to your computer and use it in GitHub Desktop.
Ajudando o menino Elland
SELECT
jb.*
FROM
jobs jb
INNER JOIN jobs_skills jbs
ON jbs.job_id = jb.id
INNER JOIN skills skj
ON skj.id = jbs.skill_id
LEFT JOIN (
candidates cn
INNER JOIN candidates_skills cns
ON cns.candidate_id = cn.id
INNER JOIN skills skc
ON skc.id = cns.skill_id
)
ON skc.id = skj.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment