Introduction: Oracle DatabaseWith its own advantages, it has won the favor of many users. Of course, the Oracle single lineDate FunctionsI believe everyone is familiar with this function. It operates on a wide range of DATA types and is widely used. The following describes the Oracle single-row date functions for your reference.
Oracle single row date functions:
Oracle single-row date functions operate on DATA types, most of which have DATA type parameters,
The vast majority of returned values are of the DATA type.
ADD_MONTHS (,)
Returns the result after date d plus I months. I can make any integer. If I is a decimal,
In this case, the database implicitly converts it to an integer, and the part after the decimal point is truncated.
LAST_DAY ()
Returns the last day of the month containing the date d.
MONTHS_BETWEEN (,)
Returns the number of months between d1 and d2. If the date of d1 and d2 is the same, or the last day of the month is used,
An integer is returned. Otherwise, the returned result contains a score.
NEW_TIME (,,)
D1 is a date data type. When the date and time in Zone tz1 are d, the date and time in Zone tz2.
Tz1 and tz2 are strings.
NEXT_DAY (,)
Returns the first day of the condition given by dow after the date d. dow specifies a day of the week using the language given in the current session,
The returned time component is the same as the time component of d.
Select NEXT_DAY ('01-Jan-2000 ', 'monday') "1st Monday ",
NEXT_DAY ('01-Nov-2004 ', 'tuesday') + 7 "2nd Tuesday ")
From dual;
1st Monday 2nd Tuesday03-Jan-2000 09-Nov-2004
ROUND ([,])
Round the date d in the format specified by fmt, and fmt is a string.
SYADATE
The function has no parameters. The current date and time are returned.
TRUNC ([,])
Returns the date d of the unit specified by fmt.
The above is all about the single-row date functions of the Oracle database that I want to introduce to you. I hope this will help you.