Oracle Common SQL Time functions

Source: Internet
Author: User

1. Query the current date and time

Select  from dual;

2. Check the last day of this month

Select  from dual;

3. How many months before and after query

Select add_months (sysdate, from dual;

4. Check the specific date of the week of the following week (Sunday-Saturday: 1-7)

Select next_day (sysdate,1 from dual;

5, Time to turn time

Select to_char (sysdate,'yyyy-mm-dd HH:MI:SS' from dual;

6. Character Turn time

Select to_date ('20160101','yyyy-mm-dd ' from dual;

7. The date of the inquiry is specific to the day of the week

Select to_char (to_date ('2016-01-01','yyyy-mm-dd' ),'day' from dual;

8, the difference between the query days

Select  Floor - to_date ('20000101','yyyymmdd '  from dual;

Oracle Common SQL Time functions

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.