You need to calculate the number of days from 1st January 2019 until today.
Dates are stored in the default format of DD-MON-RR.
Which two queries give the required output?
A. SELECT TO_CHAR(SYSDATE, ‘DD-MON-YYYY’) – ’01-JAN-2019′ FROM DUAL;
B. SELECT SYSDATE – TO_DATE(’01-JANUARY-2019′) FROM DUAL;
C. SELECT ROUND(SYSDATE – ’01-JAN-2019′) FROM DUAL;
D. SELECT ROUND(SYSDATE – TO_DATE(’01/JANUARY/2019′)) FROM DUAL;
E. SELECT TO_DATE(SYSDATE, ‘DD/MONTH/YYYY’) – ’01/JANUARY/2019′ FROM DUAL;
B,D
A returns ORA-01722: invalid number
B returns 1428.458483796296296296296296296296296296
C returns ORA-01722: invalid number
D returns 1428
E returns ORA-01722: invalid number
B and D are correct, only date values can be. subtracted each other, it is not possible with character
B,D
BD
all answers are incorrect