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

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

    The TRIM function provides a good solution for your problem. Just use some like this above:

    UPDATE yourtable SET your_field = TRIM(CHAR(9) FROM TRIM(your_field));
    

提交回复
热议问题