摘要.
使用 case when:
UPDATE cp_system_param SET `value`=CASE WHEN cp_system_param.`code`='system_name' THEN 'aa' WHEN cp_system_param.`code`='system_title' THEN 'bb' WHEN cp_system_param.`code`='web_flg' THEN 'cc' ELSE `value` END```
注意:这里SQL如果不加 ELSE END会导致别的字段值为空:


[https://blog.csdn.net/weixin_42447373/article/details/80914203](https://blog.csdn.net/weixin_42447373/article/details/80914203)
[https://blog.csdn.net/weixin_42447373/article/details/80914203](https://blog.csdn.net/weixin_42447373/article/details/80914203)