首页 > 数据库技术 > 详细

oracle

时间:2015-11-25 19:13:43      阅读:334      评论:0      收藏:0      [点我收藏+]

 

 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 * from test
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 ; 

 

oracle

原文:http://www.cnblogs.com/yinxingyeye/p/4995287.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!