【SQL学习笔记4】case when 和if的用法

1.case用法sql -- 用法一: case when 条件1 then 字段取值1 when 条件2 then 字段取值2 when 条件3 then 字段取值3 else 字段取值4-- 若是上述所有不知足,则执行 end -- 用法二: case 字段名 when 取值1 then 字段取值1 when 取值2 then 字段取值2 when 取值3 then 字段取值3 else 字
相关文章
相关标签/搜索