MM-DD-RRRR / MM-DD-YYYY 的區別【Blog 搬家】
MM-DD-RRRR / MM-DD-YYYY 的區別 (Date format)
2005 年 08 月 15日
先各位執行一下下面SQL. 結果會如何呢?
select to_date('05/01/02','YYYY-MM-DD') YYYY ,to_date ('05/01/02','RRRR-MM-DD') RRRR
from dual
結果如下:
-------------------------------------------------
YYYY RRRR
0005-01-02 00:00:00 2005-01-02 00:00:00
-------------------------------------------------
什麼原因 ?
RR
Yes Lets you store 20th century dates in the 21st century using only two digits.
See Also: Additional discussion on RR datetime format element in the Oracle Database SQL Reference
RRRR
Yes Round year. Accepts either 4-digit or 2-digit input. If 2-digit, provides the same return as RR. If you do not want this functionality, then enter the 4-digit year.
Yes Lets you store 20th century dates in the 21st century using only two digits.
See Also: Additional discussion on RR datetime format element in the Oracle Database SQL Reference
RRRR
Yes Round year. Accepts either 4-digit or 2-digit input. If 2-digit, provides the same return as RR. If you do not want this functionality, then enter the 4-digit year.
RRRR : 這邊說得如果你輸入的是2位數字 則會轉換為 四位年,如果是四位年,則保持不變。
而 YYYY 只是將同一位置上的字元轉換為要求的字元,如果為數不夠則用0 補充。
這就是RRRR /YYYY 的區別!
By -myhuaer
myhuaer 發表於:2005.08.15 10:50 ::分類: ( Oracle Infomation ) ::閱讀:(491次)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/34596/viewspace-661930/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MM-DD-RRRR / MM-DD-YYYY 的區別 (Date format)ORM
- Oracle backgroud Process【Blog 搬家】Oracle
- float datatype in Oracle database 【Blog 搬家】OracleDatabase
- Trim() 函式的介紹【Blog 搬家】函式
- oracle Distinct|Unique 異同【Blog 搬家】Oracle
- Oracle Database Link Problems【Blog 搬家】OracleDatabase
- Oracle DDL 執行過程【Blog 搬家】Oracle
- HP -Data Protector Restore file system【Blog 搬家】REST
- V$SESSION_LONGOPS bug 【Blog 搬家】SessionGo
- 限制End User Session數量 【Blog 搬家】Session
- oracle Database Event trace 設定【Blog 搬家】OracleDatabase
- Database Link 建立注意的兩點【Blog 搬家】Database
- Oracle event 10231 【Blog 搬家】Oracle
- Oracle Date Function 講解和事例【Blog 搬家】OracleFunction
- ora -03232 問題解決【Blog 搬家】
- oracle ora-00997 problems【Blog 搬家】Oracle
- exp/imp expdp/impdp Tables 萬用字元 % 的使用【Blog 搬家】字元
- RMAN 只備份當前資料?【Blog 搬家】
- Oracle Optimizer -RBO (理解Rule-based 優化器)【Blog 搬家】Oracle優化
- Database Triggers and event attributes--Introduction[Blog 搬家]Database
- 資料庫加密Product_user_profile(PUP) TABLE FOR security 【Blog 搬家】資料庫加密
- Database Triggers and event attributes--Event Attributes【Blog 搬家】Database
- Database Triggers and event attributes--Database System Events【Blog 搬家】Database
- Database Triggers and event attributes--DDL/Client Events【Blog 搬家】Databaseclient
- 原來ITPUB’s BLOG 和space是有區別的
- Oracle10g V$OSSTAT 關於PHYSICAL_MEMORY_BYTES 的 Bug【Blog 搬家】Oracle
- 搬家成功了!
- blog保姆級別開發流程七
- 圖靈搬家啦!圖靈
- 蘑菇街一鍵搬家的工具
- OLDWAIN 的BlogAI
- 搬家別怕麻煩 這些智慧產品能隨時帶走
- ??與?:的區別
- 蜂蜜的區別
- 和 的區別
- as 和 with的區別
- LinkedList和ArrayList的區別、Vector和ArrayList的區別
- http和https的區別/get和post的區別HTTP