I want to subtract the column entrystarttime
from column entryfinishtime
in the entry
table so as to get the difference in minutes up to two decimal places in Oracle database.
(我想从entry
表中的列entryfinishtime
中减去列entrystarttime
,以便在分钟之内得到Oracle数据库中最多两位小数的差异。)
Both columns' datatype is date.
(两列的数据类型均为日期。)
An example of what's inserted into the entry
table is
(entry
表中插入的示例是)
INSERT INTO entry(entrystarttime,entryfinishtime)
VALUES (TO_DATE('01-feb-2018:10:00:00 AM', 'dd-mon-yyyy:hh:mi:ss am'),
TO_DATE('01-feb-2018:10:59:30 AM', 'dd-mon-yyyy:hh:mi:ss am');
Here is what I attempted so far
(到目前为止,这是我尝试过的)
select to_date(entryfinishtime, 'dd-mon-yyyy:hh:mi:ss am') - to_date(entrystarttime, 'dd-mon-yyyy:hh:mi:ss am')from entry;
But all I get are rows of 0s.
(但是我得到的只是0行。)
Like this (像这样)
TO_DATE(ENTRYFINISHTIME,'DD-MON-YYYY:HH:MI:SSAM')-TO_DATE(ENTRYSTARTTIME,'DD-MON-YYYY:HH:MI:SSAM')
--------------------------------------------------------------------------------------------------
0
0
0
0
0
0
0
0
ask by Fish translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…