- 1、本文档共23页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
sql语句时间日期最全方法(国外英文资料)
sql语句时间日期最全方法(国外英文资料)
The application of time in Oracle
1, the conversion function
The biggest relationship to date is the two conversion functions: to_date (), to_char ()
The to_date () effect converts character types to date types in a certain format:
Specific usage: to_date ( 2004-11-27 , yyyy-mm-dd), the former is a string, the latter is the conversion date format, and notice that the two must be matched in one.
Such as; To_date ( 2004-11-27 13:34:43 , yyyy-mm-dd hh24: mi: ss) will be given a specific time
Multiple date formats:
YYYY: four years
YYY, YY, Y: the last three, two or one of the years, the default is the current century
MM: the month number of 01-12
MONTH: the MONTH when the nine characters are represented, the right is filled with white space
MON: a three-character month abbreviation
WW: the week of the year
D: the day of the week
DD: the first few days of the month
DDD: the first few days of the year
DAY: the full name of the nine characters of the DAY, and the right-hand side is filled with white space
HH, HH12: the first hour of the day, 12 in notation
HH24: the first hour of the day, the value is 00 ~ 23
MI: in an hour
SS: in a minute
SSSS: the number of seconds since midnight
To_char () : change the date to a certain format for the character type
SQL select to_char (sysdate, yyyy-mm-dd hh24: mi: ss) time from dual;
TIME
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
The 2004-10-08 15:22:58
Convert the current time to yyyy-mm-dd hh24: mi: ss format into character type
The date is processed in oracle
TO_DATE format
Day:
Dd number 12
Dy abbreviated fri
Day spelled out Friday
DDSPTH spelled out, ordinal twelfth
The Month:
Mm number 3
Mon abbreviated mar
The month spelled out a march
Year:
Yy two who 98
Yyyy four who 1998
24 hour format: 0:00-23:59:59...
12-hour format: 1:00-12:59:59...
[ZT] date and time function summarize
1.
Date and character conversion function usage (to_date, to_char)
2.
Select to_char (to_date (222, J), Jsp) from du
您可能关注的文档
最近下载
- ZJ70-4500D20石油钻机使用说(2022年-2023年)明书.docx VIP
- 2023-2024学年人教版高中信息技术必修一第二章第一节《解决问题的一般过程和用计算机解决问题》教案.docx VIP
- GB7258—2022机动车运行安全技术条件修订内容解读29.pdf
- 医学装备使用安全培训.pptx
- Unit6单元整体设计人教版九年级英语全册.pdf
- 中考数学轨迹问题集锦69739.doc VIP
- 2024年河北省继续医学教育公共必修课参考答案.pdf VIP
- 驾校学员心理调节精编.ppt
- 自考06269工程应用英语(13-19)真题试卷.doc VIP
- 智能农业传感器监测和优化农作物生长环境.pptx
文档评论(0)