【发布时间】:2019-04-21 23:28:51
【问题描述】:
我想消除重复并显示一次
例如
SELECT 'apple, apple, orange'
FROM dual;
我想展示
apple, orange
作为另一个例子。
SELECT 'apple, apple, apple, apple,'
FROM dual;
我只想展示
apple
这段代码显示
with data as
(
select 'apple, apple, apple, apple' col from dual
)
select listagg(col, ',') within group(order by 1) col
from (
select distinct regexp_substr(col, '[^,]+', 1, level) col
from data
connect by level <= regexp_count(col, ',')
)
【问题讨论】:
-
为什么标题中有日期?
-
@user7294900 抱歉,这意味着重复数据
-
你可以编辑你的问题标题
-
@JuanCarlosOropeza。谢谢!!!我做到了!!!
标签: sql regex oracle oracle11g