oracle|数据例子代码:
SELECT scheme_id,LTRIM(MAX(SYS_CONNECT_BY_PATH(win_degreen||':'||win_number||'注',',')),',') win_degreen
FROM
(
SELECT scheme_id,win_degreen,win_number,MIN(win_degreen) OVER(PARTITION BY scheme_id) win_degreen_MIN,
(ROW_NUMBER() OVER(ORDER BY scheme_id,win_degreen,win_number))+(DENSE_RANK() OVER (ORDER BY scheme_id)) NUMID
FROM scheme_prize_record T
)
START WITH win_degreen=win_degreen_MIN CONNECT BY NUMID-1=PRIOR NUMID
GROUP BY scheme_id;
ORACLE数据集纵向变横向并合并列数据
80酷酷网 80kuku.com