SQL-Displaying the Count of Unique Rows.

SQL-Displaying the Count of Unique Rows.

  
Hello,

I have a Skills Table and and Employees Table. I have an Employees_Skills Table which says which Employees have which Skills. I want an SQL statement that says how many employees have each Skill.

The SQL statement I used is below The Image shows my Output. What I want it to say is ESB- 4. Filenet 1. Rather than have 3 specific rows. Does anyone have any idea how to do this, or what I could try next?

Format:HTML Format Version:1.0 StartHTML: 165 EndHTML: 1073 StartFragment: 314 EndFragment: 1041 StartSelection: 314 EndSelection: 314
SELECT  {Skills}.[Skills], {Employee_Skill}.[InterestId], {Employee_Skill}.[ProficiencyId], {Employee_Skill}.[Total], {Skills}.[Total]
FROM {Skills} INNER JOIN {Employee_Skill}
ON {Skills}.[Id]={Employee_Skill}.[SkillId]

Hi Edward,

Try like this:

SELECT  {Skills}.[Skills],
        NULL,
        NULL,
        NULL,
        Count(1)
FROM {Skills}
INNER JOIN {Employee_Skill} ON {Skills}.[Id]={Employee_Skill}.[SkillId]
GROUP BY {Skills}.[Skills]

Not sure what you want to make with the Interest, Proficiency and one of the totals, so just placed a NULL there for the time being.

Regards,
João Rosado
Hi João.

Thanks for your reply. The query returned "No Rows". Does that mean it worked, or didn't work? How do I output this structure onto the page?

Edward
Hi João.


Update, the SQL did work. I didn't realise a fellow developer had deleted all the Skills when testing another function. It has the output. Now we just need to get this on a page. Thanks again.

Edward