SQL更新错误与替换

时间:2011-08-10 21:05:27

标签: mysql sql

我看不出这个SQL有什么问题:

UPDATE Show
SET    EnterOnine = replace(EnterOnine, 'http://projects.example.co.uk', 'http://www.example.co.uk')
WHERE  EnterOnine LIKE '%http://projects.example.co.uk%'

当我将其输入PHPmyadmin时,我收到此错误:

#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 'Show SET EnterOnine = replace(EnterOnine, 'http://projects.example.co.uk' at line 1

1 个答案:

答案 0 :(得分:5)

Show是mysql中的reserved word,使用反向标记进行转义。

UPDATE `Show` SET ...