2
Colleagues,
I have a table called salas_usuarios, this table contains all users registered in the rooms and another table called users, where I store users. But I would like to check which users are not registered in a certain room. The query I am using is the following:
SELECT *
FROM usuarios USU
INNER JOIN sala_usuarios SAL ON USU.id_usuario != SALA.codigo_usuario_fk
INNER JOIN predio PRE ON PRE.codigo_predio = SAL.codigo_predio_fk
WHERE SALA.codigo_sala =93
GROUP BY USU.id_usuario
Only it lists all users and not only room 93
Just don’t forget to use the ALIAS correctly, you defined as SAL but are using SALA. :)
– Andrew Ribeiro