Oracle single row date functions

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.