Hi everyone,
I've never had to do this before sooo, I need help. I have a table which maps managers to regular employees. So you could say that Manager A is mapped to 20 peeople and Manager B is mapped to 5, and so on.
So the table looks like this:
managerEmpID | mappedEmployee
So I need distinct manager ID's (don't want repeated data on managers!) data as well as how many employees are mapped to each manager. I know for a simple query I'd do something like this:
Select distinct managerEmpID, mappedNumOfEmps
from dbo.tblManagers
I don't know how to calculate, in a query, the number of emps each manager is mapped to.
Just to clarify, the query needs to pull each manager only once, as well as return the number of employees they're mapped to. How would I go about doing that?
Thanks.