I need to do a query where the status of that person can be A = Active, I = Inactive and B = Locked but can also be null, my query is already returning when it is A, B or I but when it is null no returns nothing.
select COD_IDENT_PESSO,
TXT_NOMEX_PESSO,
TXT_APELI_PESSO,
case FLG_SEXOX_PESSO when 'F' then 'Feminino' when 'M' then 'Masculino' end as FLG_SEXOX_PESSO,
if(DAT_NASCI_PESSO is null, '', date_format(DAT_NASCI_PESSO, '%d/%m/%Y')) as DAT_NASCI_PESSO,
case FLG_STATU_PESSO when 'A' then 'Ativo' when 'I' then 'Inativo' when 'B' then 'Bloqueado' end as FLG_STATU_PESSO,
if(DAT_ADMIS_PESSO is null, '', date_format(DAT_ADMIS_PESSO, '%d/%m/%Y')) as DAT_ADMIS_PESSO
from DB_EGLISE.tbl_PESSOAS
where COD_IDENT_IGREJ = 'ibar'
and FLG_STATU_PESSO <> 'A' or //PROBLEMA ESTA AQUI
FLG_STATU_PESSO = null //E AQUI
order by TXT_NOMEX_PESSO
In my query I need to return anything that is different from A or that is null.