如何计算Oracle中两个时间戳之间的时间差(以毫秒为单位)?
3 回答
心有法竹
TA贡献1866条经验 获得超5个赞
更简单的解决方案:
SELECT numtodsinterval(date1-date2,'day') time_difference from dates;
对于时间戳:
SELECT (extract(DAY FROM time2-time1)*24*60*60)+
(extract(HOUR FROM time2-time1)*60*60)+
(extract(MINUTE FROM time2-time1)*60)+
extract(SECOND FROM time2-time1)
into diff FROM dual;
RETURN diff;
分享编辑
- 3 回答
- 0 关注
- 1893 浏览
添加回答
举报
0/150
提交
取消