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? (Choose two.)
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? (Choose two.)
To calculate the number of days between SYSDATE and a specific date in Oracle SQL, you need to use the correct date format and functions. Option B is correct since SYSDATE is already a date type, and subtracting a date string from it properly in the format 'DD-MON-YYYY' will give the number of days. However, it needs to be enclosed in parentheses and 'DUAL' table is required for execution. Option E is also correct as it correctly transforms the string date '01-JANUARY-2019' into a date using TO_DATE function and then subtracts it from SYSDATE to return the number of days.
C is correct if you change the - operator between sysdate and to_date manually. i think there is a mistake.
https://www.examtopics.com/discussions/oracle/view/20180-exam-1z0-071-topic-2-question-44-discussion/
The only working query is E all of the others are not working.