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 ‘rank= 1000’ at line 1

原文链接: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 ‘rank= 1000’ at line 1 – 每天进步一点点

使用mysql执行下面的update语句时:

update training_problem set rank= 1000;

出现了下面的报错:

update training_problem set rank= 1000

1064 – 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 ‘rank= 1000’ at line 1
时间: 0s

报错原因是rank是mysql的关键字,解决办法也很简单,把关键字加上 ` 这个符号,也就是tab键上面那个符号(有人管它叫‘飘’)。

update training_problem set `rank`= 1000;

posted on 2025-04-10 14:37  longkui  阅读(54)  评论(0)    收藏  举报

导航