请大神帮忙告诉下面这段代码具体每段的作用和意思

select t5.psr_id,t5.times as time,
t4.VA,t4.VB,t4.VC,t4.AMP1,t4.AMP2,t4.AMP3,
t4.INSTW,t4.INSTVAR ,t4.FWDTOTW ,t4.VOLAMPR ,
t4.TOTVAR,t4.CT,t4.PT
from (
select t2.psr_id,t1.times from (
select to_char(to_date(t.dates,'yyyy-mm-dd')+(rownum -1)/96,'yyyy-mm-dd hh24:mi') times from
(select  distinct substr(time,0,10) dates  from test where rownum = 1) t
connect by rownum <=96) t1,
(select distinct PSR_ID from  test) t2) t5,
(select * from (
select PSR_ID,to_char(to_date(TIME,'yyyy-mm-dd hh24:mi'),'yyyy-mm-dd hh24:mi') time,VA,VB,VC,AMP1,AMP2,AMP3,INSTW,INSTVAR ,FWDTOTW,VOLAMPR,TOTVAR,CT,PT,row_number() over(partition by psr_id,time order by va) cnt from test
) t3 where cnt=1) t4
where t5.psr_id=t4.psr_id(+)
and t5.times = t4.time(+)
order by 1,2
标签: 暂无标签
handsomepotato

写了  篇文章,拥有财富 ,被  人关注

转播转播 分享分享 分享淘帖
回复

使用道具

成为第一个吐槽的人

您需要登录后才可以回帖 登录 | 加入社区

本版积分规则

意见
反馈