A place to ask questions, connect with others, and stay in the know
cte_AddRN AS (
SELECT mt.UserId, mt.WorkGroup,
RN = ROW_NUMBER() OVER (PARTITION BY mt.UserId ORDER BY mt.WorkGroup)
FROM CIC_PROD.dbo.UserWorkgroups mt (nolock) where workgroup like '%%ITSQL%%'
,WorkGroup_1 = MAX(CASE WHEN arn.RN = 1 THEN arn.WorkGroup END)
,WorkGroup_2 = MAX(CASE WHEN arn.RN = 2 THEN arn.WorkGroup END)
,WorkGroup_3 = MAX(CASE WHEN arn.RN = 3 THEN arn.WorkGroup END)
,WorkGroup_4 = MAX(CASE WHEN arn.RN = 4 THEN arn.WorkGroup END)
FROM cte_AddRN arn
inner join CIC_PROD.dbo.Individual (nolock) I on I.ICUserID = arn.UserId
inner join CIC_PROD.dbo.UserWorkgroups (nolock) w on w.UserId = arn.UserId
GROUP BY arn.UserId
Every year, Genesys® delivers more than 70 billion remarkable customer experiences for organizations in over 100 countries. Through the power of the cloud and AI, our technology connects every customer moment across marketing, sales and service on any channel, while also improving employee experiences. Genesys pioneered Experience as a ServiceSM so organizations of any size can provide true personalization at scale, interact with empathy, and foster customer trust and loyalty. This is enabled by Genesys Cloud™, an all-in-one solution and the world's leading public cloud contact center platform, designed for rapid innovation, scalability and flexibility. Visit www.genesys.com.