我将SQL文件导入到数据库中,但是出了点问题。句子/短语末尾的所有标点符号都有多余的空格。
示例:
This is a sentence .
This , as you can see , is a problem .
Do it !
应为:
This is a sentence.
This, as you can see, is a problem.
Do it!
要纠正,我计划在这种情况下在phpMyAdmin上运行SQL命令
UPDATE book SET content = REPLACE(content,' .','.');
UPDATE book SET content = REPLACE(content,' ,',',');
UPDATE book SET content = REPLACE(content,' ?','?');
UPDATE book SET content = REPLACE(content,' !','!');
UPDATE book SET content = REPLACE(content,' :',':');
到目前为止,一切都很好。但是当我在这样的分号上尝试过
UPDATE book SET content = REPLACE(content,' ;',';');
模拟查询时出现语法错误#1064。
我试图用这样的反斜杠转义,但存在相同的错误
UPDATE book SET content = REPLACE(content,' \;','\;');
有什么办法解决这个问题吗?
谢谢