mysql 的 case when 用法

 正确的格式:

case when condition then result
     when condition then result
     when condition then result
else result
end

 

注意事项:

稍不注意就会写成如下错误的格式:

case when condition then result
case when condition then result
case when condition then result
else result
end

 

 

参考:

https://www.cnblogs.com/xp796/p/8042100.html

https://blog.csdn.net/helloxiaozhe/article/details/78124138

https://www.cnblogs.com/renpei/p/5485730.html

 

全文完

:)

 

原文地址:

https://www.cnblogs.com/poterliu/p/9644892.html

 

posted @ 2018-09-29 15:14  poterliu  阅读(1346)  评论(0)    收藏  举报