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

前端 未结 4 1485
夕颜
夕颜 2021-01-04 03:05

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 charac

4条回答
  •  死守一世寂寞
    2021-01-04 03:34

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

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

提交回复
热议问题