有没有办法从所有值的特定列中删除所有空格?
替换all spaces:
all spaces
UPDATE `table` SET `col_name` = REPLACE(`col_name`, ' ', '')
删除所有tabs字符:
tabs
UPDATE `table` SET `col_name` = REPLACE(`col_name`, '\t', '' )
删除所有new line字符:
new line
UPDATE `table` SET `col_name` = REPLACE(`col_name`, '\n', '')
http://dev.mysql.com/doc/refman/5.0/zh-CN/string- functions.html#function_replace
删除first and last space(s)列:
first and last space(s)
UPDATE `table` SET `col_name` = TRIM(`col_name`)
http://dev.mysql.com/doc/refman/5.0/zh-CN/string- functions.html#function_trim