
这里,我使用分隔符字符串分别计算毫秒部分。如果有更好的方法,请分享它。下面是毫秒时间差的模板(字段1到字段2)。
选择
(
(
(to_timestamp(字段1,'yyyy-mm-dd hh24:MI:SS。ff9 ')+ 0)
—
(to_timestamp(字段2,'yyyy-mm-dd hh24:MI:SS。ff9 ')+ 0)
***********60 24;60
+
to_number
(
0| |
(
to_number(substr(1场,包括(1,)))
—
to_number(substr(2场,包括(2,)))
)
)
* * 1000
从表名
这里是毫秒数的区别,如果你需要显示一个小数秒,请删除()*()* 1000部分,下面是一个测试代码,直接运行:
选择
(
(
(to_timestamp('2016-04-13 17:13:50.998 ','yyyy-mm-dd hh24:MI:SS。ff9 ')+ 0)
—
(to_timestamp('2016-04-13 17:13:47.235 ','yyyy-mm-dd hh24:MI:SS。ff9 ')+ 0)
***********60 24;60
+
to_number
(
0| |
(
to_number(substr('2016-04-13 17:13:50.998,仪器('2016-04-13 17:13:50.998)))
—
to_number(substr('2016-04-13 17:13:47.235,仪器('2016-04-13 17:13:50.235)))
)
)
* * 1000
从双
研究结果如下:3763