gpt4 book ai didi

amazon-redshift - Redshift : how to remove all newline characters in a field

转载 作者:行者123 更新时间:2023-12-01 12:32:02 29 4
gpt4 key购买 nike

我想知道如何从字段中删除 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/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com