mysql> delimiter //
mysql> UPDATE `sss` SET
-> `sscore` =
-> CASE
-> WHEN `saddress` LIKE '%北京%'
-> THEN (`sscore` + 1)
-> WHEN `saddress` LIKE '%河南%'
-> THEN (`sscore` + 2)
-> WHEN `saddress` LIKE '%上海%'
-> THEN (`sscore` + 5)
-> END
-> WHERE ('sscore' >= 30) AND ('sscore' < 60)//
Query OK, 0 rows affected, 1 warning (0.00 sec)
Rows matched: 0 Changed: 0 Warnings: 1
mysql> delimiter ;
mysql>
mysql> SHOW WARNINGS;
+---------+------+--------------------------------------------+
| Level | Code | Message |
+---------+------+--------------------------------------------+
| Warning | 1292 | Truncated incorrect DOUBLE value: 'sscore' |
+---------+------+--------------------------------------------+
1 row in set (0.00 sec)
数据没有变啊?