Find the count of managers in each group
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Muhammad Imran AnsariRank #326 · 7.6K reputationPosted Feb 8, 2025, 3:10 AM EST
To find the count of managers in each group in SQL, you can use the GROUP BY clause along with the COUNT() function. Assuming you have a table named
Employeeswith the following structure:-- SQL Query SELECT GroupID, COUNT(*) AS ManagerCount FROM Employees WHERE Role = 'Manager' GROUP BY GroupID;Kiran KumarRank #1,268 · 1.4K reputationPosted Feb 9, 2025, 12:47 AM EST
I need to fetch based on the following
employee managers - count of managers assigned to employees
department managers - count of managers assigned to departments
employee and department managers - count of managers assigned to employees and departments
Attached table structure diagram