ORACLE obtains the month list between a certain period of time.

Source: Internet
Author: User


ORACLE obtains the month list between a certain period of time to obtain the month list between a certain period of time (the example returns the month list between and) www.2cto.com SELECT TO_CHAR (ADD_MONTHS (TO_DATE ('2017-03 ', 'yyyy-mm'), ROWNUM-1), 'yyyy-mm') DAY_ID from dual connect by rownum <= months_between (to_date ('2017-03 ', 'yyyy-mm'), to_date ('2017-03', 'yyyy-mm ')) + 1 get the date list for a certain period of time (the example returns the date list between and) SELECT TO_CHAR (TO_DATE ('2017-04-1 ', 'yyyy-MM-DD') + ROWNUM-1, 'yyyy-MM-DD ') DAY_ID from dual connect by rownum <= trunc (to_date ('2017-05-23', 'yyyy-mm-dd ') -to_date ('2017-04-1 ', 'yyyy-mm-dd') + 1

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.