更新时间:2022-12-28 12:56:23
替换all spaces
:
UPDATE `table` SET `col_name` = REPLACE(`col_name`, ' ', '')
要删除所有tabs
个字符:
UPDATE `table` SET `col_name` = REPLACE(`col_name`, '\t', '' )
要删除所有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)
:
UPDATE `table` SET `col_name` = TRIM(`col_name`)
http://dev.mysql.com/doc/refman/5.0/zh-CN/string-functions.html#function_trim