1 回答
TA贡献2037条经验 获得超6个赞
insert into test values('aaa','1');
insert into test values('bbb','2');
insert into test values('ccc','5');
insert into test values('ddd','3');
select wm_concat(a),wm_concat(b) from test;
WM_CONCAT(A) WM_CONCAT(B)
1 aaa,bbb,ccc,ddd 1,2,5,3
没有问题的。
drop table test;
create table test(a varchar2(30),b varchar2(30),c varchar2(30));
insert into test values('aaa','1','a');
insert into test values('bbb','2','a');
insert into test values('ccc','5','a');
insert into test values('ddd','3','a');
insert into test values('aaaaa','11','b');
insert into test values('bbbbb','22','b');
insert into test values('ccccc','55','b');
insert into test values('ddddd','33','b');
select c,max(a),max(b) from (
select c,wm_concat(a) over (partition by c order by a) a,
wm_concat(b) over (partition by c order by a) b from test
) tt
group by c ;
C MAX(A) MAX(B)
a aaa,bbb,ccc,ddd 1,2,5,3
b aaaaa,bbbbb,ccccc,ddddd 11,22,55,33
- 1 回答
- 0 关注
- 79 浏览
添加回答
举报