case when语法
select
name 名字,
case sex
when 0 then '男'
when 1 then '女'
end 性别
from employee
判断为空的语法
SELECT name 名字,
case when sex is null then '未知'
when sex = 0 then '男'
when sex = 1 then '女'
else '其他'
end 性别
from employee