我有一个 mysql 表,其中包含以下字段:
id, desc, value, people, amount, weight
按照上述顺序,我运行以下命令
update match1 set weight = 5 where desc = 'fat' and id != '6';
以下是我收到的错误消息:
**#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 'desc = 'bat' and id = 6' at line 1
有人可以告诉我这有什么问题吗?
最佳答案
列desc
是mysql中的关键字。使用反引号,即
where `desc` = 'fat'
关于mysql - 使用过滤器更新 mysql 表时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5692323/