Mysql 内置方法 “case when”方法

case 方法:

  Demo1:

    case  xx  

       when "xx" then "xx"

       else "xx"

    end 

  Demo2: (case when then 判断 null 时的写法) 

   case  when  xx is null 

        then 'xx'

        else 'xx' 

        end

猜你喜欢

转载自blog.csdn.net/qq_27727251/article/details/79667011