Query all roles that are not assigned
SELECT Id, Name FROM UserRole WHERE Id NOT IN (SELECT UserRoleId FROM User WHERE UserRoleId !='')
Query all roles that are assigned
SELECT Id, Name FROM UserRole WHERE Id IN (SELECT UserRoleId FROM User WHERE UserRoleId !='')
Query all roles assigned or not assigned:
SELECT Id, Name FROM UserRole
Comments
Post a Comment