運行select to_char(to_date('911','J'),'Jsp') as a from dual
顯示結果為:Nine Hundred
Eleven
而運行select to_date('911','J') as a from
dual
顯示結果為:0000-0-0
關于to_date(numberstring,'J')和to_char后面的那個"Jsp"各有什么作用?
J:Julian day; the number of days since January 1, 4712 BC. Number specified with
'J' must be integers.
SP:Spelled
Number
他的做法是先把數字轉為一個數字,然后再轉換回來,加上SP,就可以拼寫出這個數字了。