去掉字段中的空格
#去掉左边空格
UPDATE user SET name=LTRIM(name);
#去掉右边空格
UPDATE user SET name=RTRIM(name);
#去掉全部(左右)空格
UPDATE user SET name=TRIM(name);
## 查询和去掉换行符 \r\n
SELECT *FROM `user` WHERE name LIKE "%\r\n%";
UPDATE `user` SET name = REPLACE( REPLACE( name , CHAR( 10 ) , '' ) , CHAR( 13 ) , '' );