Boa tarde!
Eu gostaria de fazer um query assim:
select
case tab.colunaA
when 'A' then 'Ok'
when 'B' then 'Ok'
when 'C' then 'Ok'
when 'D' then 'Ok'
when 'E' then 'Err'
when 'F' then 'Err'
when 'G' then 'Err'
end as resultadoA,
case resultadoA when 'Err' then 'Problemas' end as complemento
from tab
Mas recebo o retorno column "resultadoA" does not exist.
Como posso fazer para usar o resultado da coluna nomeada?
Obrigado.
Douglas