Playing With Date in Oracle is not easy. A date has many different types of the format while inserting in Database. Here we are using Oracle Database for getting a range of Date . Here you can Find Month Range.

How to get Date range in Oracle?
How to get Start Date and End Date range in Oracle?
From Date and To Date range in Oracle?

If you Want to Download Oracle  click here.

This Query:
 
select add_months(TO_DATE('01-04-2018','dd-mm-yyyy'),(case when months_between(TO_DATE('01-12-2018','dd-mm-yyyy'),TO_DATE('01-04-2018','dd-mm-yyyy'))=0 then 0 else rownum end)) month_year
from dual connect by rownum<=months_between(TO_DATE('01-12-2018','dd-mm-yyyy'),TO_DATE('01-04-2018','dd-mm-yyyy'))
union select TO_DATE('01-04-2018','dd-mm-yyyy') from dual;

Output

Post a Comment

Previous Post Next Post