I’m trying to figure out how I can select all active users that does not have a workgroup set.
I have the user table with the col active (1=true) to see if the user is active. BUT, one user can have multiple “roles” in the system, and each of the roles has a set of settings.
Workgroup is a setting in the userrolesetting, its ID is 1000. I want to get all users that is missing the workgroup or where the workgroup is null.
I’ve trying to go with:
SELECT *
FROM user U
INNER JOIN userrole R
ON R.uid = U.uid
INNER JOIN userrolesetting S
ON R.rid = S.rid
WHERE U.active = 1
This is totally nonsence, but I’m really confused on how to attack it.
Try the following:
Share and enjoy.