zoukankan      html  css  js  c++  java
  • Oracle 计算时间格式平均值

    select
    to_char((to_date('2019-07-01', 'yyyy-mm-dd') + numtodsinterval(avg(begin_time_second), 'second')),'hh24:mi:ss') avg_begin_time,
    to_char((to_date('2019-07-01', 'yyyy-mm-dd') + numtodsinterval(avg(end_time_second), 'second')),'hh24:mi:ss') avg_end_time
    --2019-07-01 00:00:00 + numtodsinterval(平均数,'秒')转换为日期格式,然后再转换为 时间字符格式
    from
    (
      select
      --把上班时间换算为秒
      to_char(a.actontime, 'hh24') * 3600 +
      to_char(a.actontime, 'mi') * 60 +
      to_char(a.actontime, 'ss') as begin_time_second,
      --把下班时间换算为秒
      to_char(a.actofftime, 'hh24') * 3600 +
      to_char(a.actofftime, 'mi') * 60 +
      to_char(a.actofftime, 'ss') as end_time_second
      from empworkdate a
    )

  • 相关阅读:
    #include <boost/scoped_ptr.hpp>
    #include <boost/function.hpp>
    #include <boost/bind.hpp>
    8.4散列表查找
    #include <boost/array.hpp>
    异常
    lambda
    #include <amp.h>
    #include <bitset>
    #include <hash_set>
  • 原文地址:https://www.cnblogs.com/hong-dan/p/11418219.html
Copyright © 2011-2022 走看看