- Get link
- X
- Other Apps
The below queries will remove all spaces, tabs characters, new line characters first and last space(s) from the table column.
For replace all spaces :
UPDATE `table` SET `col_name` = REPLACE(`col_name`, ' ', '')
For remove all tabs characters :
For remove all tabs characters :
UPDATE `table` SET `col_name` = REPLACE(`col_name`, '\t', '' )
For remove all new line characters :
For remove all new line characters :
UPDATE `table` SET `col_name` = REPLACE(`col_name`, '\n', '')
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace
For remove first and last space(s) of column :
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace
For remove first and last space(s) of column :
UPDATE `table` SET `col_name` = TRIM(`col_name`)
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_trim
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_trim
Comments
Post a Comment