根据起始日期获取这个段内之间所有日期信息
SELECT TO_CHAR(TO_DATE('2016-01-1','YYYY-MM-DD')+ROWNUM-1 ,'YYYY-MM-DD') DAY_ID FROM DUAL
CONNECT BY ROWNUM<=trunc(to_date('2016-12-31', 'yyyy-mm-dd')-to_date('2016-01-01', 'yyyy-mm-dd'))+1
根据起始日期获取这个段内之间所有日期信息
SELECT TO_CHAR(TO_DATE('2016-01-1','YYYY-MM-DD')+ROWNUM-1 ,'YYYY-MM-DD') DAY_ID FROM DUAL
CONNECT BY ROWNUM<=trunc(to_date('2016-12-31', 'yyyy-mm-dd')-to_date('2016-01-01', 'yyyy-mm-dd'))+1
转载于:https://www.cnblogs.com/kkfish/p/5266436.html