select Fieldx = CASE WHEN IT.UNIDADE=PRD.UNID1 THEN 1 WHEN IT.UNIDADE=PRD.UNID2 THEN PRD.FACONV ELSE PRD.FACONV3 END from ...Utilizando ORACLE, a instrução é:
select Fieldx = (DECODE(IT.UNIDADE, PRD.UNID1,1, PRD.UNID2,PRD.FACONV PRD.FACONV3 )) from ...Eu utilizei o DECODE para comparar se o com é igual a determinada expressão
select fieldx = Case when p.IncIcms = 0 then 0 when p.IncIcms <> 0 and t.UsoMens = 'A' then 200 when p.IncIcms <> 0 and t.UsoMens <> 'A' and AliqICMS = 0 then ?Estados.AliqIcms when p.IncIcms <> 0 and t.UsoMens <> 'A' and AliqICMS <> 0 then AliqICMS end from ...Obrigado!