Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to generate MM-YYYY from current month

Orcl ApexJan 23 2019 — edited Jan 24 2019

Hi,

As you know this is 23-JAN-2018, and month is JAN-18, I want to generate 24 rows for next 2 years from current month.

SELECT TO_CHAR(SYSDATE, 'MM-YYYY') dates FROM DUAL;

Above will give me 01-2019 as dates.

Now I want to have more 24 rows from 02-2019 to 01-2021 LIke -

01-2019

02-2019

03-2019

04-2019

.

.

.

.

.

01-2021

This post has been answered by L. Fernigrini on Jan 23 2019
Jump to Answer
Comments
Post Details
Added on Jan 23 2019
6 comments
2,312 views