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 8

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


MKR

MKR

Correct answer is

C.
Option C

MKR

MKR

SQL> select to_char(to_date(’11-oct-2007′), ‘fmDdspth “of” Month, Year’) from dual;

TO_CHAR(TO_DATE(’11-OCT-2007′),’FMDDSPTHOFMONTH,YEAR’)
—————————————————————————
Eleventh of October, Two Thousand Seven

Oguns

Oguns

Yeap, answer is C.

Mani

Mani

Yah. Answer is C

Livia

Livia

@MKR, You actually tested the version A with spth, not C.
A is correct.

The Tuk

The Tuk

SQL> select to_char(’11-oct-2007′,’fmDdspth “of” Month,Year’) from dual ;
select to_char(’11-oct-2007′,’fmDdspth “of” Month,Year’) from dual
*
ERROR at line 1:
ORA-01722: invalid number

SQL>

Shivi

Shivi

Can someone give a proper explanation of option A being right.