日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

Oracle TO_DATE

 昵稱62509612 2019-03-03

This tutorial explains how to use Oracle TO_DATE function with basic syntax and examples.

TO_DATE function convert a character string to a date format.

Syntax:

TO_DATE(char[, 'format_model'], [nlsparams])
  • Char : The character that will be converted to a date

  • 'format_model' : format that will be used to convert char to a date. If format_model is not specified, the format is DD-MON-YY. and It can be one or a combination of the following values:

ParameterExplanation
SCC or CCCentury; server prefixes BC date with –
Years in dates YYYY or SYYYYYear; server prefixes BC date with –
YYY or YY or YLast three, two, or one digits of year
Y, YYYYear with comma in this position
IYYY, IYY, IY, IFour-, three-, two-, or one-digit year based on the ISO standard
SYEAR or YEARYear spelled out; server prefixes BC date with –
QQuarter of year
MMMonth: two-digit value
MONTHName of month padded with blanks to length of nine characters
MONName of month, three-letter abbreviation
RMRoman or brown
WW or WWeek of year or month
DDD or DD or DDay of year, month, or week
DAYName of day padded with blanks to a length of nine characters
DYName of day; three-letter abbreviation
JJulian day; the number of days since December 31, 4713 BC
RRRRAccepts a 2-digit year and returns a 4-digit year.
A value between 0-49 will return a 20xx year.
A value between 50-99 will return a 19xx year.
HHHour of day (1-12).
HH12Hour of day (1-12).
HH24Hour of day (0-23).
MIMinute (0-59).
SSSecond (0-59).
SSSSSSeconds past midnight (0-86399).
AM, AM, PM, or PMMeridian indicator
  • Nlsparams : has the same purpose in this function as in the TO_CHAR function for date conversion

Example:

Let's get some examples about Oracle TO_DATE and how to use it:

SELECT to_date ('2019/03/01', 'yyyy/mm/dd')FROM   dual;
Oracle to_date
SELECT TO_DATE('030119', 'MMDDYY')FROM   dual;
Oracle to_date
SELECT TO_DATE('20190301', 'yyyymmdd')FROM   dual;
Oracle to_date
SELECT TO_DATE('2019/03/01 18:00:59', 'YYYY/MM/DD HH24:MI:SS'), TO_DATE('2019/02/05 09:19:59', 'YYYY/MM/DD HH:MI:SS')FROM   dual;
Oracle to_date

Source :  https://www./wiki/oracle-to-date

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多