時間戳計算時間 結果秒

with t as
(select (max(t.status_date)) t1 , (min(t.create_date))   t2
          from abs_generl.prodord_sku_his  t
         where t.customer_num = '29001SN011900016'
)

select abs((trunc(t1 - 0, 'mi') - trunc((t2 - 0), 'mi')) * 24 * 60 * 60 +
extract(second from t1 - t2))
from t


with t as
(select t.status_date t1 , t.create_date   t2
          from abs_generl.prodord_sku_his  t
         where t.customer_num = '29001SN011900016'
)

select abs((trunc(t1 - 0, 'mi') - trunc((t2 - 0), 'mi')) * 24 * 60 * 60 +

extract(second from t1 - t2))

from t

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章