Oracle
 sql >> Base de Dados >  >> RDS >> Oracle

Oracle subtraindo dias e minutos


Use um literal de intervalo :
SELECT SYSDATE - INTERVAL '10 00:05' DAY(2) TO MINUTE
FROM   DUAL

Ou:
SELECT SYSDATE - INTERVAL '10' DAY - INTERVAL '5' MINUTE
FROM   DUAL

Ou apenas use aritmética:
SELECT SYSDATE - 10 /* Days */ - 5 / 24 /60 /* Minutes */
FROM   DUAL

Ou use NUMTODSINTERVAL :
SELECT SYSDATE - NUMTODSINTERVAL( 10, 'DAY' ) - NUMTODSINTERVAL( 5, 'MINUTE' )
FROM   DUAL