[Quote=引用 8 楼 quiettown 的回复:]
select A, substr(max(sys_connect_by_path(B,',')),2) as value
from (
select A, B, row_number()over(partition by A order by B) as rn
from test
)
start with rn = 1
connect by rn - 1 = prior rn and A= prior A
group by A;
[/Quote]
select A, substr(max(sys_connect_by_path(B,',')),2) as value
from (
select A, B, row_number()over(partition by A order by B) as rn
from test
)
start with rn = 1
connect by rn - 1 = prior rn and A= prior A
group by A;