I have a table with People and roles, and I want to select people who do not have the Head of Department role in a selection.
The problem is that if you have the role, the user also shows it and I want it to be shown at the moment you have the role of boss.
Select Id_usuario
from union_pers_rols
where Id_rol != 'Jefe Departamento'
Table union_pers_rols 2 columns: User_id (Is a name) Id_rol, Has the (role) of that person
I have to remove all the people who do not have the "Department Head" role. The problem is that there are users with more than 1 role in that "User" table Then I get the name of that person because he is taking it by the role User
Before the select: User_id Id_rol
edu@
Usuario
jaime@
Jefe Departamento
jaime@
Root
jaime@
Usuario
nose@
Usuario
pass@
Usuario
After the selection
Id_usuario
edu@
jaime@
jaime@
nose@
pass@
As you can see, he takes me out to Jaime @ because he also has other roles = (