01-20-2023 05:39 AM
Hi Team,
I'm trying to extract a report to know the count of external employees under each manager.
This is the query I'm using, but it is throwing some "count does not exist" errors.
Can team help me with this to fix it?
SELECT
m.username,
m.FIRSTNAME,
m.LASTNAME,
COUNT (u1.username) AS 'number_of_Externalemployees'
FROM users u1 INNER JOIN users m ON u1.owner= m.username
where u1.EMPLOYEETYPE = 'External'
GROUP BY m.username;
Solved! Go to Solution.
01-20-2023 07:24 AM
Try below query
SELECT
m.username,
m.FIRSTNAME,
m.LASTNAME,
COUNT(u1.username) AS 'number_of_Externalemployees'
FROM users u1 INNER JOIN users m ON u1.owner= m.username
where u1.EMPLOYEETYPE = 'External'
GROUP BY m.username;