select tt.a,tt.b,B.d,substr(max(sys_connect_by_path(tt.c,',')),2) from (select A.a,A.b,A.c,1+row_number()over(partition by A,a,A.b order by A.a,A.b)seq1, row_number()over(partition by A,a,A.b order by A.a,A.b) seq2 from A)tt,B where tt.a=B.a and tt.b=B.b start with tt.seq2=1 connect by tt.seq2=prior tt.seq1 group by tt.a,tt.b,B.d试试 可不可以,我测试是成功的
from (select A.a,A.b,A.c,1+row_number()over(partition by A,a,A.b order by A.a,A.b)seq1,
row_number()over(partition by A,a,A.b order by A.a,A.b) seq2 from A)tt,B
where tt.a=B.a
and tt.b=B.b
start with tt.seq2=1
connect by tt.seq2=prior tt.seq1
group by tt.a,tt.b,B.d试试 可不可以,我测试是成功的