3
I need to do a query where that person’s status can be A = Active, I = Inactive and B = Blocked but it can also be null, my query is already returning when it is A, B or I but when it is null it 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 you to return anything other than A or null.
Tries with
AND (FLG_STATU_PESSO IS NULL OR FLG_STATU_PESSO <> 'A')
– Anthony Accioly