Select Case

#89853
Avatar de Leonardo LitzLeonardo Litz
Participante

Veja se é isso que vc imagina:

select case when (COD_UF = ‘SP’ and CD_CIDADE = ‘EM2’ and (DE_CEP between 10 and 59 or DE_CEP between 80 and 84)) then
‘SP Capital’
when (COD_UF = ‘SP’ and CD_CIDADE = ‘EM2’ and (DE_CEP between 60 and 79 or DE_CEP between 85 and 99)) then
‘SP Interior’
else
‘Outros’
end
from CEP3

Vlw Leonardo Litz

plugins premium WordPress