我正在尝试将"?t"
字符串替换为"'t"
(撇号)
我在phpMyAdmin中输入此命令
UPDATE "myTable"
SET "myColumn" = REPLACE ("myColumn", "\?t", "\'t")
如How can I use mySQL replace() to replace strings in multiple records?)
中所述我收到此错误
#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 #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 UPDATE "myTable"
SET "myColumn" = REPLACE ("myColumn", "\?t", "\'t") at line 1
我的命令出了什么问题?
由于
答案 0 :(得分:1)
不要引用表名或列名。如果你需要逃脱它们,请使用反引号
UPDATE `myTable`
SET `myColumn` = REPLACE (`myColumn`, '?t', '\'t')