QuestionQ152

VerifiedUsing Conversion Functions and Conditional Expressions

Calculate the number of days from 1st Jan 2007 through the current date.

Dates are stored in the default format of dd-mm-rr.

Which two SQL statements would produce the required output?

Choose two
Explanation

SYSDATE returns a DATE, and subtracting one DATE from another produces the number of days between them. TO_DATE converts each January 1, 2007 character literal to a DATE, allowing valid date arithmetic. Oracle permits flexible matching of date punctuation unless exact-format matching is requested.

Learn more

Community Discussion

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