Which SQL statement would give the required result?

YOU need to display the date ll-oct-2007 in words as ‘Eleventh of October, Two Thousand
Seven’. Which SQL statement would give the required result?

YOU need to display the date ll-oct-2007 in words as ‘Eleventh of October, Two Thousand
Seven’. Which SQL statement would give the required result?

A.
Option A

B.
Option B

C.
Option C

D.
Option D



Leave a Reply 6

Your email address will not be published. Required fields are marked *


deepak

deepak

C is correct.

SELECT TO_CHAR(TO_DATE(’11-oct-2007′), ‘fmDdthsp “of” Month, year’) from dual
Eleventh of October, two thousand seven

9jansen

9jansen

A

There will be an implicit data conversion of ’11-oct-2007′ appropriately as well as a need to differentiate between TO_CHAR and TO_DATE in this question deliberately.

TO_CHAR: To convert a datetime to a value of VARCHAR2 data type in the format specified by the date format fmt (i.e., fmDdspth).

TO_DATE: To convert char of a character data type to a value of DATE data type.

fm stands for fill mode.

Subham

Subham

OPTION A gives an error.
option c executes successfully and provides the required result

Wacha Mollo

Wacha Mollo

C
A gives error