我正在寻求帮助以解决Oracle SQL查询问题。我试图找到两列之间的区别。这是查询格式
((TO_CHAR (TRUNC (SYSDATE) +
numtodsinterval(DECODE(
LAG(e.actualdeparttime, 1, 0) OVER (Partition by es.evstrname ORDER BY e.actualdeparttime),1,0,
(LAG(e.actualdeparttime, 1, 0) OVER (Partition by es.evstrname ORDER BY e.actualdeparttime))),'second'),'hh24:mi'))
- (TO_CHAR (TRUNC (SYSDATE) + numtodsinterval(DECODE( e.actualarrivetime, -1, 0, e.actualarrivetime), 'second'),'hh24:mi'))) as time_taken
查询显示和错误。请帮忙。谢谢
GG