1.
case '字段' when (字段= 值1) then 结果
when (字段=值2) then 结果
else 结果
end
eg.
select a.id,a.status,a,age from a
(case status when status='1' then "在会"
when status='0' then "未知"
when statsu='-1' then '离开'
end) =1
这个sql 可将 status为1 的 记录查询出来
2.另外 case when (表达式1)then 结果
when (表达式1) then 结果
else 结果
end