mysql 的 case when 用法

时间:2023-03-09 19:16:46
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.****.net/helloxiaozhe/article/details/78124138

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

全文完

:)

原文地址:

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