SQL 返回期间内的所有日期
代码如下:
select rownum as dateIndex,to_date('20090701','yyyy-mm-dd')+ rownum-1 AS DATE_ FROM DUAL CONNECT BY LEVEL >= 1 AND LEVEL <=(TO_DATE('20090731','yyyy-mm-dd')-TO_DATE('20090701','yyyy-mm-dd')+1)
result:
1 2009/07/01
2 2009/07/02
3 2009/07/03
4 2009/07/04
5 2009/07/05
6 2009/07/06
7 2009/07/07
8 2009/07/08
9 2009/07/09
10 2009/07/10
11 2009/07/11
12 2009/07/12
13 2009/07/13
14 2009/07/14
15 2009/07/15
相关推荐
xuanlvhaoshao 2020-05-07
militala 2020-01-13
cjylean 2019-12-04
tanrong 2020-01-14
Carlos 2020-01-08
明月清风精进不止 2020-01-01
tanrong 2019-12-13
明月清风精进不止 2019-10-23
zhangdonghang 2019-07-18
chenxcd 2019-09-06
sylalak 2014-08-30
FightFourEggs 2010-08-14
廖金龙 2013-03-20
wangcomputer00 2012-07-06
windex000 2018-10-15
libingjy 2016-10-05
MikeG 2015-07-26