oracle查询开始时间和结束时间之间的连续月份
SELECT TO_CHAR(ADD_MONTHS(TO_DATE('2023-01','YYYY-MM'), ROWNUM - 1), 'YYYY-MM') AS fmonth FROM DUAL
CONNECT BY ROWNUM <= CEIL(MONTHS_BETWEEN(TO_DATE('2023-11', 'YYYY-MM'), TO_DATE('2023-01','YYYY-MM'))+1)```
SELECT TO_CHAR(ADD_MONTHS(TO_DATE('2023-01','YYYY-MM'), ROWNUM - 1), 'YYYY-MM') AS fmonth FROM DUAL
CONNECT BY ROWNUM <= CEIL(MONTHS_BETWEEN(TO_DATE('2023-11', 'YYYY-MM'), TO_DATE('2023-01','YYYY-MM'))+1)```