Hi All,
I want to find the users(userid) from a permissions table who have all of the given permissions. Something like :
select userid, permission from permissions where all_of permissions in ('view', 'delete', 'add', 'edit');
Note: this query is not to do with mysql permissions. It is a generic question, assuming that I have a user_permissions table which has the following fields & data:
The query I'm asking should return
userid | permission
1 | view
1 | add
2 | view
2 | delete
2 | add
2 | edit
userid
2
Please let me know if this is not clear.
Thanks in advance