【发布时间】:2022-01-06 06:11:47
【问题描述】:
输入数据
ID CID
1 101,103
1 101
在目标中,我是这样的,我使用了 listagg 函数
ID CID
1 101,103,101
但我想要下面的输出
ID CID
1 101,103
【问题讨论】:
标签: informatica listagg
输入数据
ID CID
1 101,103
1 101
在目标中,我是这样的,我使用了 listagg 函数
ID CID
1 101,103,101
但我想要下面的输出
ID CID
1 101,103
【问题讨论】:
标签: informatica listagg
先使用 distinct 然后使用 listag。可以参考下面的SQL。
SELECT
subqry.ID as id,
listagg(cid,',') within group(order by(id)) as cid
FROM
(select distinct ID, CID from FROM Table1) subqry -- this will deduplicate CIDs first
group by id
Order by 1
--
【讨论】: