我正在尝试计算每条记录的两个日期之间的周转时间。
SELECT SPECCODE, SOURCECODE, SOURCEDESCRIPTION, **TO_CHAR( TO_DATE (PATCASE.ORDEREDDATE, 'YYYYMMDD'))"ORDER_DATE", CURRENT_DATE** FROM ...........
答案 0 :(得分:3)
你可以使用简单的减法:
SELECT
TRUNC(TO_DATE (PATCASE.ORDEREDDATE, 'YYYYMMDD') - SYSDATE) AS days_diff
FROM ...;
<强> DBFiddle Demo 强>