Oracle中以毫秒为单位的时间戳之间的差异

2021-12-24 00:00:00 sql oracle11g oracle oracle10g plsql

我有表 test1 并且有一列 DOJ,其时间戳数据类型很少,如下所示.这里我需要 doj 和 systimestamp 之间的差异 im 毫秒.

I have table test1 and have one column DOJ with timestamp datatype having few records as shown below. Here i need the difference im milliseconds between doj and systimestamp.

SELECT DOJ FROM TEST1; 
DOJ 
---------------------------- 
21-MAR-14 09.25.34.514526000 
21-MAR-14 09.25.34.520345000 
22-MAR-14 09.25.34.523144000 
22-MAR-14 09.25.34.527770000 
23-MAR-14 09.25.34.532482000 
23-MAR-14 09.25.34.535603000 
24-MAR-14 09.25.34.538556000 
24-MAR-14 09.25.34.541729000 

SELECT SYSTIMESTAMP FROM DUAL; 
SYSTIMESTAMP 
-------------- 
24-MAR-14 09.48.10.251556000 +00:00 

有人可以帮我解决这个问题吗.

Can some one please help me with this.

推荐答案

select
  extract(second from systimestamp - doj) * 1000
from
  test1;

相关文章