示例1、
SELECT
case sex WHEN 1 THEN '男'
WHEN 2 THEN '女'
WHEN 3 THEN '未知'
END sex,
count(*) as num from s_loy_member GROUP BY sex
示例1、
SELECT
case sex WHEN 1 THEN '男'
WHEN 2 THEN '女'
WHEN 3 THEN '未知'
END sex,
count(*) as num from s_loy_member GROUP BY sex
本文标题:case when then用法
本文链接:https://www.haomeiwen.com/subject/dvzekktx.html
网友评论