How to remove tabs at start and end of varchar field in MySQL?


Problem :

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?



Solution :

You can still use the TRIM function, and specify the character to be trimmed:

UPDATE mytable SET email = TRIM(CHAR(9) FROM TRIM(email));

Mysql Tutorials

Mysql Howto..

How to make table read only?

How to write the mysql query for return 4 rows exactly

How can I increase read queries/second on my database?

How to choose which JDBC driver to use? [closed]

PHP -MySQL insert and select statements - how to make them atomic?

How to structure MySQL db for storing multiple checkbox form data and later do statistics in php?

MySQL - How to select records that match all IN values but in 1 or more tables

How to be enable to use man command for mysql

MySQL: How-to optimize query with two indentical subqueries?

How to run a MYSQL query on a pre-defined fixed time?

How to select data from database Mysql and add it on DataGridView?

Set date format with existing records php mySQL. How?

MySQL how to deal with nulls passed into a case statement

how to create table and insert data inside it but if there is table already the same name just insert data and do not create table anymore

How to select table in mysql with comparison by 2 rows using value from array?

Mysql - How to create column that automatically sums rows?

MySQL command-line tool: How to find out number of rows affected by a DELETE?

How do I sort data from a mysql db according to a unique and predetermined order, NOT asc or desc

How to delete thousands of rows with PHP and MySQL in background?

How to connect to Magento after I've changed the password for database?

show data that exists in both MYSQL tables and/or R objects

SQL How to replace values of select return?

How to set up primary key, auto increment, and indexes in row versioned MySQL table (SCD type 2)?

AndroidPlot: Unable to show line chart from List data in Android app

How to store and get exact characters in mysql db?

How to get sum of two alias tables result in main result in mysql?

How to put more than one relational id in one column mysql?

Getting data from database showing it as json response

How can I append a string to an existing field in MySQL?

How to download, unzip and import to mysql dump all via piping?