QuestionQ52

VerifiedUsing Conversion Functions and Conditional Expressions

Which SQL statement shows the date March 19, 2001 in the format "Nineteenth of March 2001 12:00:00 AM"?

Explanation

Oracle TO_DATE converts the character date using DD-Mon-YYYY, and TO_CHAR formats it for display. DDSPTH produces the spelled ordinal day, quoted "of" emits literal text, MONTH and YYYY produce the month and year, and HH:MI:SS AM renders midnight as 12:00:00 AM. The FM modifier suppresses format-model padding, so no extra spaces appear around the month or time components.

Learn more

Community Discussion

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