文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>存储过程 插入数据 一天的时间内的统计数量

存储过程 插入数据 一天的时间内的统计数量

时间:2010-05-28  来源:fome2010

create or replace procedure webtongji IS
BEGIN
BEGIN
      INSERT INTO t_event_webtongji
    SELECT (SELECT COUNT(ID)
          FROM T_EVENT T
         WHERE EVENTSTATEID = 05
           AND T.C_CREATETIME BETWEEN
               (SELECT ((SYSDATE-1 - TO_DATE('19700101080000','YYYY-MM-DD HH24MISS')) * 24 * 60 * 60 * 1000) AS TIME
                  FROM DUAL) AND
               (SELECT (SYSDATE -
                       TO_DATE('19700101080000', 'YYYYMMDDHH24MISS')) * 24 * 60 * 60 * 1000 AS TIME
                  FROM DUAL)),
       (SELECT COUNT(ID)
          FROM T_EVENT T
         WHERE T.C_CREATETIME BETWEEN
               (SELECT ((SYSDATE-1 - TO_DATE('19700101080000','YYYY-MM-DD HH24MISS')) * 24 * 60 * 60 * 1000)  AS TIME
                  FROM DUAL) AND
               (SELECT (SYSDATE -
                       TO_DATE('19700101080000', 'YYYYMMDDHH24MISS')) * 24 * 60 * 60 * 1000 AS TIME
                  FROM DUAL)),
       (SELECT COUNT(ID) FROM T_EVENT T),
       ((SYSDATE - TO_DATE('19700101080000', 'YYYY-MM-DD HH24MISS')) * 24 * 60 * 60 * 1000)
  FROM DUAL;
 
  EXCEPTION
    WHEN OTHERS THEN
      ROLLBACK;
 END;
  COMMIT;
EXCEPTION
  WHEN OTHERS THEN
    ROLLBACK;
end webtongji;
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载