oracle Rank()语句

select pw.gdjname,pw.gdsname,pw.bdzname,pw.lineid,pw.linename,dmrt.transformerid,dmrt.transformername,  case when dmrt.transformerclass = 1 then '公变' when dmrt.transformerclass = 2 then '农变'   when dmrt.transformerclass = 3 then '专改公' end as 配变类别,   dmrt.transformersize, cjdb.ct, cjdb.pt, qq.oi_idf, qq.adl, qq.adldate, qq.ady, qq.afz, qq.bdl,    qq.bdldate, qq.bdy, qq.bfz, qq.cdl, qq.cdldate, qq.cdy, qq.cfz from    (select a.oi_idf,a.adl,a.adldate,a.ady,a.afz,b.bdl,b.bdldate,b.bdy,b.bfz, c.cdl,c.cdldate,c.cdy,c.cfz,c.townrowid    from (select * from (select rank() over(partition by oi_idf order by adl,ady,afz,adldate desc) rk,dmr_maxdlfz.*  from dmr_maxdlfz where adldate>= '2009-11-1 0:00:00' and adldate<= '2009-11-5 23:59:59') t where   t.rk<=1  ) a  left join ( select t.oi_idf,t.bdl,t.bdldate,t.bdy,t.bfz,t.townRowID from (select rank() over(partition by oi_idf order by bdl,bdy,bfz,bdldate  desc)  rk,dmr_maxdlfz.* from dmr_maxdlfz where bdldate>='2009-11-1 0:00:00' and bdldate<='2009-11-5 23:59:59' ) t where   t.rk<=1  ) b on a.oi_idf = b.oi_idf left join ( select t.oi_idf,t.cdl,t.cdldate,t.cdy,t.cfz,t.townRowID,t.rk    from (select rank() over(partition by oi_idf order by cdl,cdy,cfz,cdldate desc) rk,dmr_maxdlfz.*    from dmr_maxdlfz where cdldate>='2009-11-1 0:00:00' and cdldate<='2009-11-5 23:59:59') t where   t.rk<=1  ) c on b.oi_idf = c.oi_idf  ) qq    inner join dmr_measurepoint dmrm on dmrm.measurepointrowid = qq.oi_idf  inner join dmr_transformer dmrt on dmrt.transformerrowid =  dmrm.transformerrowid    left join cj_dbctpt cjdb on cjdb.oi_idf = dmrm.measurepointrowid   inner join oj_group_pw pw on pw.dbid = qq.oi_idf   where  qq.adldate >= '2009-11-1 0:00:00' and qq.adldate < '2009-11-5 23:59:59'  and pw.bdzid=5076858 order by  pw.gdjname,pw.gdsname,pw.bdzname,pw.lineid,qq.adldate,qq.bdldate,qq.cdldate

配网管理 —> 数据统计分析-最大电流

转载于:https://www.cnblogs.com/linpengfeixgu/articles/1609668.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值