SQL query to get the majority
I have a database with the following tables:
Employee (EmpID, FirstName, LastName, RegionID)
EmployeeSkills(EmpID, SkillID) [this is a linking table for the M:N relationship between Employees and skills]
Skills(SkillID, Description)
I need to provide the name of a skill that most employees have. I tried to do max(count(skillID))
, sqlserver said you cannot do an aggregate function to an aggregate function. Any other ideas?
Thank you in advance!
+2
a source to share
4 answers