Mysql:Trim all fields in database

前端 未结 7 1731
一生所求
一生所求 2021-02-12 08:20
UPDATE mytable SET mycolumn= LTRIM(RTRIM(mycolumn));

works fine on trimming columns removing trailer spaces, but how can i adjust it to trim all column

相关标签:
7条回答
  • 2021-02-12 09:11

    you expand the query for each column:

    UPDATE mytable
    SET mycolumn = LTRIM(RTRIM(mycolumn)),
        mycolumn2 = LTRIM(RTRIM(mycolumn2)),
        ...;
    
    0 讨论(0)
提交回复
热议问题