How to remove tabs at start and end of varchar field in MySQL?
I've got a field in a mysql db that's a varchar(255). I've looked at trim() to remove leading and trailing whitespace, but it seems to only handle spaces, not tab characters:
UPDATE mytable SET textfield = TRIM(textfield);
Does anyone know how to also strip tabs off the start and end of a field?
You can still use the
TRIM function, and specify the character to be trimmed:
UPDATE mytable SET email = TRIM(CHAR(9) FROM TRIM(email));
- A Linux, Apache, MySQL, PHP (LAMP) stack is a combination of open source software that is typically installed together to enable a server to host dynamic […]
- MySQL is an the most popular open-source database management system, in most of hosting company its has been bundle by LAMP(Linux, Apache, MySQL, PHP/Python/Perl) stack. Another alternative […]
- MySQL is the world’s most popular open-source database. Despite its powerful features, MySQL is simple to set up and easy to use. Below are some instructions […]