QuestionQ102

VerifiedUsing Single-Row and Aggregate Functions

You need to calculate the number of days from 1 January 2019 through today.

Dates are stored in the default DD-MON-RR format.

Which two queries return the required output?

Choose two
Explanation

TO_DATE converts the supplied character value to a DATE; when its format model is omitted, Oracle uses the session default date format. Subtracting the resulting DATE from SYSDATE returns the elapsed number of days. ROUND in C removes the fractional-day portion, while E returns the unrounded day difference. Oracle documents that string-to-date conversion can use flexible matching and alternative datetime format elements unless exact-format matching is requested.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!