`
aa8945163
  • 浏览: 276213 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

大数据数据

 
阅读更多
create or replace procedure pcd_event_mintab_perday(intervalNum in number)
is
interval_number number;
begin
interval_num := intervalNum;--范围(1-60)单位:分钟
--总体事件统计
insert into rpt_total_event_start(start_time,end_time,uuid_cnt,dvc_type,custom8)
select start_time,end_time,uuid_cnt,dvc_type,custom8
       from ( select max(start_time) as start_time,max(end_time) as end_time,
            nvl(count(uuid),0) as uuid_cnt,dvc_type,custom8,dd,hh,mi
            from (select t.uuid,t.start_time,t.end_time,t.dvc_type,custom8,
                         to_char(t.end_time,'yyyy-mm-dd') as dd,
                         to_char(t.end_time,'hh24') as hh,
                         to_char(trunc((to_number(to_char(t.end_time,'MI'))/interval_num))) as mi
                  from sim_event t
                  where t.custom8 is not null
                        and(t.end_time >= to_date("2010-03-31 00:00:00",'yyyy-mm-dd hh24:mi:ss')
                        and t.end_time <= to_date("2010-03-31 23:59:59",'yyyy-mm-dd hh24:mi:ss')          
                        )
                  group by dd,hh,mi,dvc_type,custom8                                                           
                
            )
      
       );
commit;
end pcd_event_mintab-perday
/


begin
      sys.dbms_job.submit(
                          job => :job,
                          what => 'pcd_event_mintab_perday(5);',
                          next_date => to_date('13-06-2010','dd-mm-yyyy'),
                          interval => 'trunc(sysdate+4)'
      );
commit;
end;
/
分享到:
评论
1 楼 java老大爷 2017-12-21  
技术扶持 技术交流  汇聚程序员精英   群里有马士兵2017java,架构大数据最新视频下载 支持手机在线观看  群号233025331

相关推荐

Global site tag (gtag.js) - Google Analytics