posted 11 years ago
Hi,
I have two views:
JOB
------------
jobId, SkillId
and
PERSON
-----------
personId, SkillId
The job view returns:
1, 1
1, 2
The person view returns
1, 1
2, 1
3, 1
3, 2
I'm trying to write a query where it returns the person that has all the skills for the job. So the job view only has one job which requires skill 1 and 2.
The only person that matches that criteria is personid 3
I thought of
select *
from person p, job j
where p.jobid = j.jobid
but it returns all the people because all the people match on at least one skill..
I was thinking I may need to count the skills and count how many skills the person matches on and do it that way, but is there a simpler way?
Thanks
Billy