Multiple criteria seach

labanitup

New member
Local time
Today, 19:56
Joined
Jun 17, 2008
Messages
7
In my project, I need to find all employees with particular skill set. Knowing that I have 2 tables, the employee and the skill.
Let's say I am selecting 3 different skills, the result of the query is all the employees having one of the 3 skills.
What i want is only the employees with these 3 skills.
Can somebody help me ?
 
Sounds like you are OR ing the skills instead of And ing them.

Brian
 
I did try the and but it retourns me a blank table . I can't use the and I think
 
Yes my bad idea, Try a second query against the result of the first, groupby employee count skills and criteria=3 in the skill column.

Brian
 
Well I thought of that but you can have employees with 3 skills but not the selected skills so if you put = 3 it wont work .
 
Surely if you have only selected on the 3 skills in query1 then , only those are passed to query2 for the count.

Brian
 
Since you ALREADY know the skills, the following example will show you the names:

SELECT EmployeeID FROM
(
SELECT EmployeeID, SkillID from Table3
Where SkillID IN (1, 5, 6) { Substitute the 1, 5, and 6 with the Proposed Skill IDs }
)
Group by EmployeeID Having Count(EmployeeID)=3; :)
 

Users who are viewing this thread

Back
Top Bottom