update api_visit_ua ua set total_count = total_count + 10 where id = '1645332340066418692'; update api_visit_ua ua set total_count = total_count + 20 where id = '1645332340066418694'; 报错了, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'update api_visit_ua ua set total_count = total_count + 20 where id = '16' at line 7
时间: 2024-03-08 16:48:25 浏览: 51
SCE.rar_SCE_SCE-UA_sce matlab_参数识别_参数识别 matlab
这个错误提示是 MySQL 语法错误,因为在一个 SQL 语句中不能包含多个 SQL 语句,需要将两个 update 语句分开执行。你可以将这两个 SQL 语句分别执行,或者使用事务将这两个 SQL 语句包装起来,然后一起提交,例如:
```
BEGIN;
update api_visit_ua ua set total_count = total_count + 10 where id = '1645332340066418692';
update api_visit_ua ua set total_count = total_count + 20 where id = '1645332340066418694';
COMMIT;
```
这样就可以避免一个 SQL 语句包含多个 SQL 语句的错误了。
阅读全文