Monday, March 4, 2013

Query to display all the dates between two dates in oracle


select level id,
  to_date('01-01-2010','dd-mm-yyyy') + rownum -1
  from   dual
  where
  rownum <= to_date('27-04-2010','dd-mm-yyyy')-to_date('01-01-2010','dd-mm-yyyy')+1
  connect by level <= to_date('27-04-2010','dd-mm-yyyy') - to_date('01-01-2010','dd-mm-yyyy');

No comments:

Post a Comment