更新时间:2021-11-07 22:24:19
我认为这应该起作用,假设对于每个SEQ
值,总会有一行带有ROWSEQNUM=1
的行,并且ROWSEQNUM
的值按顺序增加没有缝隙.
I think this ought to work, assuming that for each SEQ
value there is always a row with ROWSEQNUM=1
and the values for ROWSEQNUM
increase sequentially with no gaps.
select seq, min(rowseqnum), max(assoc_list)
from (
select seq, rowseqnum, sys_connect_by_path(assisting_associate,';') assoc_list
from assoc_table
start with rowseqnum=1
connect by seq = prior seq and rowseqnum = prior rowseqnum + 1
)
group by seq