17,377
社区成员
发帖
与我相关
我的任务
分享
Table 2-16 lists suffixes that can be added to datetime format elements:
Table 2-16 Date Format Element Suffixes
Suffix Meaning Example Element Example Value
TH
Ordinal Number
DDTH
4TH
SP
Spelled Number
DDSP
FOUR
SPTH or THSP
Spelled, ordinal number
DDSPTH
FOURTH
Notes on date format element suffixes:
When you add one of these suffixes to a datetime format element, the return value is always in English.
Datetime suffixes are valid only to format output. You cannot use them to insert a date into the database.
SQL> select to_char(to_date(222,'yyyy'),'yyyysp') from dual;
TO_CHAR(TO_DATE(222,'YYYY'),'Y
------------------------------------------
two hundred twenty-two
SQL>
J Julian day; the number of days since January 1, 4712 BC. Number specified with J must be integers.
SP Spelled Number
--这个确实奇怪 是将数值转换成英文
SQL> select to_char(to_date(222,'J'),'Jsp') from dual;
TO_CHAR(TO_DATE(222,'J
----------------------
Two Hundred Twenty-Two
1* select to_char(to_date(2222314,'J'),'JSP') from dual
SQL> /
TO_CHAR(TO_DATE(2222314,'J'),'JSP')
------------------------------------------------------------------
TWO MILLION TWO HUNDRED TWENTY-TWO THOUSAND THREE HUNDRED FOURTEEN