首页 > 数据库技术 > 详细

oracle的数据库,随笔

时间:2015-04-28 20:19:30      阅读:253      评论:0      收藏:0      [点我收藏+]

不多说,看代码

select b.*,a.kscj,a.paiming from (select t.kch,t.kcm,t.kscj,t.xh,
        rank() over (order by t.kscj desc) paiming //排名用的
        from CJ_LRCJB t where t.kch=#{kch}
        order by kscj desc) a,(select t.kch,t.kcm,count(kscj) as total,max(kscj) as max_score,min(kscj) as min_score from (select
        t.kch,t.kcm,t.kscj from CJ_LRCJB t where t.kch=#{kch}
        order by kscj desc) t
        group by t.kch,t.kcm) b where a.kch=b.kch and a.kcm=b.kcm and xh=#{xh}

oracle的数据库,随笔

原文:http://www.cnblogs.com/zrui-xyu/p/4463703.html

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