Mysql 错误代码:1064-您的SQL语法有错误

Mysql 错误代码:1064-您的SQL语法有错误,mysql,Mysql,我对这段代码有一个非常奇怪的问题: Update creature_template SET health_min=(health_min * 0.03) where entry in (select entry from creature where rank ='1'); Update creature_template SET health_max=(health_max * 0.03) where entry in (select entry from creature where ra

我对这段代码有一个非常奇怪的问题:

Update creature_template SET health_min=(health_min * 0.03) where entry in (select entry from creature where rank ='1');
Update creature_template SET health_max=(health_max * 0.03) where entry in (select entry from creature where rank ='1');
错误发生在:2021-01-07 13:27:46 线路编号:1 错误代码:1064-您的SQL语法有错误;检查与MySQL服务器版本相对应的手册,以获取第1行“=”1')附近要使用的正确语法

我使用mysql 8.x,我是一个初学者。在mysql 5.x中,这个问题不存在。
如果有人能帮忙,我将不胜感激。

rank
在英语中是一个保留字。你需要用回击来逃避它

... where `rank` = '1' ...

rank可能是一个整数,因此应该使用rank=1,而不是将其与字符串进行比较的class='1'?如果您可以发布数据样本,可能可以进一步提供帮助。