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
配网管理 —> 数据统计分析-最大电流