select case column_name1
when value1 then result1
[when value2 then result2.....][else result]
end [as column_new_name]
[,case
when expr1 then result1
[when expr2 then result2...]
[else result]
end [as column_new_name]
[,case...]
]
from tb_name;
select case column_name1
when value1 then result1
[when value2 then result2.... ][else result]
end [as column_new_name]
[,case
when expr1 then result1
[when expr2 then result2...]
[else result]
end [as column_new_name]
[,case...]
]
from tb_name;