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;
时间: 2024-10-29 11:53:41