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

前端 未结 4 1482
夕颜
夕颜 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:18

    You can use replace with either \t or CHAR(9):

    UPDATE mytable SET email = REPLACE(TRIM(email), '\t', '');
    

提交回复
热议问题