--查询20190101至20241231 之间所有月末的日期
select ROWNUM,
to_char(add_months(last_day(to_date('20190101', 'yyyymmdd')),
+ROWNUM - 1),
'yyyymmdd') as lastdate
from dual
connect by ROWNUM <=
months_between(to_date('20241231', 'yyyymmdd'),
to_date('20190101', 'yyyymmdd'))
10-13
2501
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-20
3591
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-29
4166
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)