case when 用法
select m.id,m.name,
(case when m.`type`= 5 then '身份证'
when m.`type`= 6 then '护照'
when m.`type`= 7 then '港澳通行证'
else '其他' end) as '证件类型'
from customer_table m
case when 用法
select m.id,m.name,
(case when m.`type`= 5 then '身份证'
when m.`type`= 6 then '护照'
when m.`type`= 7 then '港澳通行证'
else '其他' end) as '证件类型'
from customer_table m