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

2017-05-02 by Jinyang | Filed under 技术相关.

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     

发表评论

您的电子邮箱不会被公开。 标记为 * 的区域必须填写

返回顶部