QuestionQ127

VerifiedManaging Data in Different Time Zones

Calculate the number of days from 1st January 2019 through today.

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

Which two queries return the required output?

Choose two
Explanation

Oracle date arithmetic subtracts one DATE value from another and returns the number of days between them. A character value in the session’s default date format can be converted to DATE for a date expression, and TO_DATE converts a qualifying character value to DATE; therefore the valid expressions subtract 1 January 2019 from SYSDATE. TO_DATE without an explicit format model relies on the default date format, so specifying a format model is generally safer.

Learn more

Community Discussion

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