oracle TIMESTAMP日期相减

select extract(day from inter) * 24 * 60 * 60 +  
       extract(hour from inter) * 60 * 60 + extract(minute from inter) * 60 +  
       extract(second from inter) "seconds"  
  from (select to_timestamp('20100115112233', 'yyyymmddhh24miss') -  
               to_timestamp('20100101123456', 'yyyymmddhh24miss') inter  
          from dual);

 

posted @ 2016-09-05 18:28  Earic  阅读(7164)  评论(0编辑  收藏  举报