17,377
社区成员
发帖
与我相关
我的任务
分享
select a,max(substr(sys_connect_by_path(b,','),2)) from (
select a,b,row_number() over(partition by a order by b) rn from (select a.name a,b.name b,rownum rn from a,b where a.pkid=b.pkid1)
start with rn=1
connect by rn=rownum
)
start with rn=1
connect by rn-1=prior rn
group by a
写的有点问题,但是要求应该满足了
group by A.NAME
select A.NAME, wmsys.wm_concat(B.MSG) MSG
from A,B
WHERE
A.PKID=B.PK_A