Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Countof External Employees Under Each Manager

Puspanjali
New Contributor
New Contributor

 

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;

 

 

Puspanjali_0-1674221099956.png

 

1 REPLY 1

sk
All-Star
All-Star

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;


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.