如何使用 python date 按天在 mySQL 中提取数据?说我想要day1
并且day2
(或后天day1
)迭代n
多次
所以我需要“where”SQL语句中的日期在每次迭代中看起来像下面的列表(n
次)
day1 >= '2012-01-01' and day2 < '2012-01-02' ( n = 1 )
day1 >= '2012-01-02' and day2 < '2012-01-03' ( n = 2 )
.
.
day1 >= yesterday and day2 < today ( n times )
.
Start_date = '2012-01-01' <- How can I write this in python
End_date = Today() <- and this
这样写:
for each iteration ..
con.execute("select * from table where date >= day1 and date < day2" )