首页 > 技术文章 > oracle获取某时间段内的年份、月份、日期列表

time-on 2017-08-29 10:54 原文

参考 http://www.2cto.com/database/201506/404733.html

 

select to_char(to_date('2016-12-07', 'yyyy-mm-dd') + rownum - 1,
               'yyyy-mm-dd') as daylist
  from dual
connect by rownum <=
           trunc(sysdate - to_date('2016-12-07', 'yyyy-mm-dd')) + 1;

 

推荐阅读