Show Users Assigned to a Specific Role

Your rating: None Average: 2.3 (4 votes)

In a previous post I showed you how to know what Roles are assigned to a specific user. But here is how you find out what Users are assigned to a specific Role.

SELECT C.OPRID ,
  C.OPRDEFNDESC ,
  A.ROLENAME    ,
  A.DESCR
   FROM PSROLEDEFN A,
  PSROLEUSER B      ,
  PSOPRDEFN C
  WHERE B.ROLENAME = A.ROLENAME
AND C.OPRID        = B.ROLEUSER
AND B.ROLENAME LIKE UPPER(:1)
GROUP BY C.OPRID,
  C.OPRDEFNDESC ,
  A.ROLENAME    ,
  A.DESCR
ORDER BY C.OPRID;

Please try to help out with unanswered topics on the forum. Chances are you have had the same issue/question some time in your IT career!