gpt4 book ai didi

sql - 如何替换 Teradata select 语句中的多个字符串

转载 作者:行者123 更新时间:2023-12-05 09:13:39 25 4
gpt4 key购买 nike

我需要从表中进行选择,但要删除各种字符串。假设我表中的条目是:

DataMart1:Here is some data and other valuable data
HouseWareMart Other data possibly junk data
DataLake3 there is nothing here

我想删除各种字符串: “有值(value)的数据” “其他数据” “什么都没有”

所以我会得到:

DataMart1:Here is some data and other
HouseWareMart possibly junk data
DataLake3 here

我考虑过嵌套 OREPLACE,但语法不正确,搜索“嵌套 OREPLACE”没有任何帮助。

有什么建议吗?

最佳答案

嵌套替换的语法:

select oreplace(oreplace(oreplace(col, 'Valuable data', ''), 'Other data ', ''), 'there is nothing ', '')

关于sql - 如何替换 Teradata select 语句中的多个字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55796344/

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