--oracle 求两个日期之间的所有日期
SELECT TO_CHAR((TO_DATE(KSRQ, 'yyyy-MM-dd') + (ROWNUM - 1)), 'yyyy-MM-dd') DT
FROM DUAL
CONNECT BY ROWNUM <=
(TO_DATE(JSRQ, 'yyyy-MM-dd') - TO_DATE(KSRQ, 'yyyy-MM-dd') + 1)
---------------------
作者:Danishlyy1995
来源:CSDN
原文:https://blog.csdn.net/u012934325/article/details/82119685
版权声明:本文为博主原创文章,转载请附上博文链接!
SELECT TO_CHAR((TO_DATE(KSRQ, 'yyyy-MM-dd') + (ROWNUM - 1)), 'yyyy-MM-dd') DT
FROM DUAL
CONNECT BY ROWNUM <=
(TO_DATE(JSRQ, 'yyyy-MM-dd') - TO_DATE(KSRQ, 'yyyy-MM-dd') + 1)
SELECT TO_CHAR((TO_DATE('20180101', 'yyyy-MM-dd') + (ROWNUM - 1)), 'yyyy-MM-dd') DT
FROM DUAL
CONNECT BY ROWNUM <=
(TO_DATE('20181231', 'yyyy-MM-dd') - TO_DATE('20180101', 'yyyy-MM-dd') + 1)