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!

Make a range of months between a period

Petri BRAug 23 2010 — edited Aug 24 2010
I want to make a select that gives me a range of months between a period.

I have some initial date and some final date, I want to make a select that returns all the possible months between these dates.


Like that:
Initial date: 01/08/2009
Final date: 16/06/2010

The select would return:

MONTH | YEAR
-----------------------
08 | 2009
09 | 2009
10 | 2009
11 | 2009
12 | 2009
01 | 2010
02 | 2010
03 | 2010
04 | 2010
05 | 2010
06 | 2010

Remembering, I just have two dates, so for a single register I will get a list of months.
Can anyone help me with that please?

Thank you all.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 21 2010
Added on Aug 23 2010
13 comments
51,794 views