What would be a sql query to remove \n\r from the text?

后端 未结 7 1739
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-17 15:13

I am using MySQL. My data has a column called text, which uses the TEXT data type.

There are several newlines for each record in this column. I want to

7条回答
  •  醉梦人生
    2020-12-17 15:23

    The previous suggestions did not work for me. It only seems to work if I had actually typed the \r and \n text in as text. I found the following to work well -

    replace(replace([MyFieldName],char(13),''),char(10),'')
    

    I also created a calculated field in my table which uses this formula. That way I can just reference that field in areas of my program that were breaking with the original field contents.

提交回复
热议问题