清除mysql数据库表中的异常空格字符串

2017-05-02 | By Jinyang | Filed in: 技术相关.

UPDATE english_words_5000_double SET word = REPLACE(word, ‘\t’, ” );commit;
UPDATE english_words_5000_double SET word = REPLACE(word, ‘\n’, ” );commit;
UPDATE english_words_5000_double SET word = REPLACE(word, ‘\r’, ” );commit;
UPDATE english_words_5000_double SET word = REPLACE(word, ‘ ‘, ” );commit;
UPDATE english_words_5000_double SET word1 = unhex(REPLACE(hex(word1), ‘C2A0’, ” )), word2 = unhex(REPLACE(hex(word2), ‘C2A0’, ” ));commit;
UPDATE english_words_5000_double SET word = TRIM(word);commit;

 

 

 

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     

发表评论

电子邮件地址不会被公开。 必填项已用*标注