I have 2 tables (official and official_situation). I need to bring the officials in their proper situations.
The big x of the issue is not to bring some employees who are in some situations (exception).
I have this query, but it still displays the codes I do not want to appear.
Where am I going wrong?
SELECT DISTINCT
a.funcionario_situacao,
b.funcionariosituacao_title AS title
FROM (".DB_FUNCIONARIO." a
JOIN ".DB_FUNCIONARIOSITUACAO." b ON a.funcionario_situacao = b.funcionariosituacao_id)
WHERE a.funcionario_situacao NOT IN (:excecao)
ORDER BY b.funcionariosituacao_title ASC", "excecao=1,2,3,4,5,14,15"