正确的格式:
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
全文完
:)
原文地址: