Mysql:Trim all fields in database

前端 未结 7 1942
耶瑟儿~
耶瑟儿~ 2021-02-12 08:37
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条回答
  •  闹比i
    闹比i (楼主)
    2021-02-12 08:53

    UPDATE mytable SET 
    mycolumn = LTRIM(RTRIM(mycolumn)), 
    mycolumn2 = LTRIM(RTRIM(mycolumn2)) 
    

    and so on, and so forth.

提交回复
热议问题