判断是否为null:
select case when 字段名 is null then '自定义值' else 字段名 end as "别名"
from table
判断 int 类型:
select case
when 字段名 = 条件 then 自定义值1
when 字段名 = 条件 then 自定义值1
else 自定义值2 end as "别名"
from table
判断字符串:
select case 字段名 when '条件' then '自定义值' else '自定义值2' end as "别名"
from table
select case when 字段名 = '条件' then '自定义值1' else '自定义值2' end as "别名"
from table