我敢肯定这是以前的参考,但我一直在寻找一个解决办法整个上午。我觉得实现这一点可能有多种方法。我所需要做的就是减去timeout-timein或columns(t\u0-t\u i)。代码中有一些额外的列,但我尝试了不同的方法。
SELECT d.Sched_Time,
d.Time_In,
d.Time_Out,
TO_CHAR(d.Time_Out, 'HH24:MI:SS') AS T_O,
TO_CHAR(d.Time_In, 'HH24:MI:SS') AS T_I,
(d.Time_Out - d.Time_In) AS Units,
TO_Timestamp(d.Time_Out, 'DD.MM.YYYY:HH24:MI:SS') AS Nope,
d.Activity_Desc,
d.Sched_Duration
FROM Clients c
INNER JOIN DAILY_LOG_DATA d
ON c.SHISID = d.SHISID
WHERE c.SHISID = 5019051
这是table:
运行此列时:
TO_Timestamp(d.Time_Out, 'DD.MM.YYYY:HH24:MI:SS') AS Nope
它去掉了我需要计算的次数。
尝试时:
TO_CHAR(d.Time_Out, 'HH24:MI:SS') - TO_CHAR(d.Time_In, 'HH24:MI:SS') AS T_I,
我得到:sql错误[1722][22005]:[oracle][odbc][ora]ora-01722:无效数字
暂无答案!
目前还没有任何答案,快来回答吧!