SELECT user_id FROM user_accounts
INNER JOIN roles_users
ON (user_accounts.user_id = roles_users.user_id)
WHERE roles_users.role_id IN (1)
Is what i tried.
What i wish is to select all users user_id, that are only a user (role_id 1). In my application everyone has role_id 1, and then they got a new row with their user_id and role_id with either 2,3,4 if they are a partner,admin,etc.
So how can i select all users user_id
that ONLY have 1 row in roles_users, with the role_id 1?
MySQL