gpt4 book ai didi

sql - Oracle Get Records where String not present as Sub string in other rows?

转载 作者:行者123 更新时间:2023-12-04 14:11:17 26 4
gpt4 key购买 nike

嗨,这是我的问题:-

Value
-----
ABCDE
ABCD
ABC
ABF
ABFG

结果应该是:ABCDE & ABFG

以上不是同一列中没有重复出现的任何其他字符串的子串

最佳答案

你可以这样做:

select *
from my_table t1
where not exists (
select 1 from my_table t2
where t1.value <> t2.value
and t2.value like '%' || t1.value || '%'
)

关于sql - Oracle Get Records where String not present as Sub string in other rows?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53949826/

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