gpt4 book ai didi

mysql - 如何通过sql替换数据库中的撇号

转载 作者:行者123 更新时间:2023-11-28 23:59:51 24 4
gpt4 key购买 nike

我正在尝试将 "?t" 字符串替换为 "'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

我的命令有什么问题?

谢谢

最佳答案

不要引用表名或列名。如果您需要转义它们,请使用反引号

UPDATE `myTable`
SET `myColumn` = REPLACE (`myColumn`, '?t', '\'t')

关于mysql - 如何通过sql替换数据库中的撇号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30275832/

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