SQL query for a carriage return in a string and ultimately removing carriage return

后端 未结 10 1535
-上瘾入骨i
-上瘾入骨i 2020-12-04 17:37

SQL query for a carriage return in a string and ultimately removing carriage return

I have some data in a table and there are some carriage returns in places where I

10条回答
  •  时光说笑
    2020-12-04 18:00

    The main question was to remove the CR/LF. Using the replace and char functions works for me:

    Select replace(replace(Name,char(10),''),char(13),'')
    

    For Postgres or Oracle SQL, use the CHR function instead:

           replace(replace(Name,CHR(10),''),CHR(13),'')
    

提交回复
热议问题