gpt4 book ai didi

mysql - 更新列时出现语法错误

转载 作者:行者123 更新时间:2023-11-29 06:50:13 26 4
gpt4 key购买 nike

我正在尝试使用以下代码来更新列:

UPDATE user_profiles 
SET range = '20', colResize = 'flex'
WHERE uid='472';

我收到以下错误:

Failed to execute SQL : SQL UPDATE user_profiles SET range = '20', colResize = 'flex' WHERE uid='472'; failed : 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 'range = '20', colResize = 'flex' WHERE uid='472'' at line 1

我忽略了什么?

最佳答案

范围reserved keyword in MySQL 。使用反引号转义名称或使用其他列名称。

SET `range` = 20

关于mysql - 更新列时出现语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47824214/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com