我想知道如何从字段中删除 Redshift 中的所有换行符。我试过这样的事情:
replace(replace(body, '\n', ' '), '\r', ' ')
和
regexp_replace(body, '[\n\r]+', ' ')
但它没有用。如果您知道如何执行此操作,请分享。
最佳答案
使用 chr(10)
而不是 \n
例子:
select replace(CONCAT('Text 1' , chr(10), 'Text 2'), chr(10), '-') as txt
关于amazon-redshift - Redshift : how to remove all newline characters in a field,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32367106/