我导入一个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,' \;','\;');
知道如何解决这个问题吗?
谢谢