ORALCE 中查询当前月的所有日期

1. 查询将来 6 个月的月份:

SELECT to_char(add_months(SYSDATE, ROWNUM), 'yyyy-mm')

  FROM dual

CONNECT BY ROWNUM <= 6

1

2. 查询当前月的所有日期

SELECT TRUNC(SYSDATE, 'MM') + ROWNUM - 1

  FROM DUAL

CONNECT BY ROWNUM <= TO_NUMBER(TO_CHAR(LAST_DAY(SYSDATE), 'dd'))

2

你可能感兴趣的:(oralce)