case when用法小结

case 对比字段 when 值 then 输出结果 when 值 then 输出结果 ....else 输出结果 end

对比字段可以不在case后面确定 可以把条件直接写在when后面,如果对比字段在case后面确定了when后面就只能输入值而不能输入条件

多个then包括else后面的输出结果必须保证数据类型一致

posted @ 2017-04-27 16:46  逗比浪波万  阅读(233)  评论(0编辑  收藏  举报