码迷,mamicode.com
首页 > 数据库 > 详细

oracle的数据库,随笔

时间:2015-04-28 20:22:41      阅读:134      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!