分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow
89. You need to display the date 11-oct-2007 in words as 'Eleventh of October, Two Thousand Seven'.
Which SQL statement would give the required result?
A. SELECT TO_CHAR('11-oct-2007', 'fmDdspth "of" Month, Year')
FROM DUAL;
B. SELECT TO_CHAR(TO_DATE('11-oct-2007'), 'fmDdspth of month, year')
FROM DUAL;
C. SELECT TO_CHAR(TO_DATE('11-oct-2007'), 'fmDdthsp "of" Month, Year')
FROM DUAL;
D. SELECT TO_DATE(TO_CHAR('11-oct-2007','fmDdspth ''of'' Month, Year')) 错。
FROM DUAL;
Answer: C答案解析:参考:http://blog.csdn.net/rlhua/article/details/12832885A错误,'11-oct-2007'本来就是字符,就不用再to_charB中'fmDdspth of month, year'的of需要用双引号引起来。C正确。D跟A一样的错误,'11-oct-2007'本来就是字符,就不用再to_char。 实验验证:A,scott@TEST0924> 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 numberBscott@TEST0924> SELECT TO_CHAR(TO_DATE('11-oct-2007'), 'fmDdspth of month, year') FROM DUAL;SELECT TO_CHAR(TO_DATE('11-oct-2007'), 'fmDdspth of month, year') FROM DUAL *ERROR at line 1:ORA-01821: date format not recognized
Cscott@TEST0924> SELECT TO_CHAR(TO_DATE('11-oct-2007'), 'fmDdthsp "of" Month, Year') FROM DUAL;
TO_CHAR(TO_DATE('11-OCT-2007'),'FMDDTHS---------------------------------------Eleventh of October, Two Thousand SevenDscott@TEST0924> SELECT TO_DATE(TO_CHAR('11-oct-2007','fmDdspth ''of'' Month, Year')) FROM DUAL;SELECT TO_DATE(TO_CHAR('11-oct-2007','fmDdspth ''of'' Month, Year')) FROM DUAL *ERROR at line 1:ORA-01722: invalid number
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow