摘要:
SELECT COL1,LTRIM(MAX(SYS_CONNECT_BY_PATH(COL2,',')),',') COL2 FROM ( SELECT COL1,COL2,MIN(COL2) OVER(PARTITION BY COL1) COL2_MIN, (ROW_NUMBER() OVER(ORDER BY COL1,COL2))+(DENSE_RANK() OVER (ORDER BY COL1)) NUMID FROM T2 ) START WITH COL2=COL2_MIN CONNECT BY PRIOR NUMID= NUMID-1 GROU 阅读全文