更新列时出现语法错误

时间:2017-12-15 00:35:46

标签: mysql

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

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

我在俯瞰什么?

1 个答案:

答案 0 :(得分:2)

rangereserved keyword in MySQL。使用反引号来转义名称或使用其他列名。

SET `range` = 20