Hi Paolo,
thanks for the reply. I tried the following:
1. SELECT * FROM users WHERE roles.name = 'Role1' AND roles.name = 'Role2'
Result Count: 4
Out of the 4 items 3 user have only the role "Role1" and 1 user has both roles assigned.
2. SELECT * FROM users WHERE roles.name IN ('Role1') AND roles.name IN ('Role2')
Same results like descripted in 1.
3. SELECT * FROM users WHERE roles.name IN ('Role1', 'Role2')
Result Count: 5
Out of the 5 items 3 user have only the role "Role1", 1 user has only the role "Role2" and 1 user has both roles assigned.
Only the user with both roles assigned is correct. The others a wrong.
Regards,
Michael