Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/06/2024 05:35 AM
analytics report query to show data with user and there manager details
pls help
Solved! Go to Solution.
09/06/2024 05:53 AM
SELECT u1.username AS "User Name",
u1.firstname AS "User First Name",
u1.lastname AS "User Last Name",
u1.email AS "User Email",
u2.username AS "Manager User Name",
u2.firstname AS "Manager First Name",
u2.lastname AS "Manager Last Name",
u2.email AS "Manager Email"
FROM users u1
LEFT JOIN users u2
ON u1.manager = u2.userkey
WHERE u1.statuskey = 1
09/06/2024 05:56 AM
I have a list of users , i need the data of the managers of that particular users .pls share that query
09/06/2024 05:58 AM
Hey @Growit You can learn basic of SQL from below website https://www.w3schools.com/sql/
SELECT u1.username AS "User Name",
u1.firstname AS "User First Name",
u1.lastname AS "User Last Name",
u1.email AS "User Email",
u2.username AS "Manager User Name",
u2.firstname AS "Manager First Name",
u2.lastname AS "Manager Last Name",
u2.email AS "Manager Email"
FROM users u1
LEFT JOIN users u2
ON u1.manager = u2.userkey
WHERE u1.statuskey = 1
AND u1.username in ('ABCD','Rushi')
ABCD & Rushi is username of users