SQL> insert into b (id, value)
2 select a.value, listagg(a.id, '!') within group (order by a.id)
3 from a
4 group by a.value;
3 rows created.
SQL> select * From b;
ID VALUE
---------- --------------------------------------------------
ABC 1001!1003
CDE 1002
PWD 1004
SQL>
1条答案
按热度按时间5ktev3wc1#
看起来更像一个
INSERT
,不是UPDATE
. 不管怎样,LISTAGG
这两种情况都有帮助。