Does the MySQL TRIM function not trim line breaks or carriage returns?

后端 未结 10 1814
旧时难觅i
旧时难觅i 2020-12-03 13:58

From my experiments, it does not appear to do so. If this is indeed true, what is the best method for removing line breaks? I\'m currently experimenting with the parameters

10条回答
  •  庸人自扰
    2020-12-03 14:20

    My line breaks were in the middle of the string, and I didn't have control over the source data. The following mysql command worked for me:

    REPLACE(FIELD,'\r\n',' ')
    

提交回复
热议问题