To format a date in Oracle SQL, TO_CHAR function is used to convert date types to string with a specified format:
Option A: SELECT TO_CHAR(SYSDATE, 'FMDAY, DD MONTH, YYYY') FROM DUAL;
This correctly applies the date format model 'FMDAY, DD MONTH, YYYY', which will display the date as requested: "MONDAY, 21 MAY, 2019". FM modifier is used to remove padding blanks or leading zeros.
Options B, C, and D do not achieve the desired output:
Option B is incorrect because TO_DATE converts a string to a date, not format a date.
Option C and D have incorrect format strings that do not match the required output format.
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit