sql >> Base de Datos >  >> RDS >> Oracle

Oracle restando días y minutos

Use un intervalo literal :

SELECT SYSDATE - INTERVAL '10 00:05' DAY(2) TO MINUTE
FROM   DUAL

O:

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

O simplemente usa la aritmética:

SELECT SYSDATE - 10 /* Days */ - 5 / 24 /60 /* Minutes */
FROM   DUAL

O use NUMTODSINTERVAL :

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