在mysql中执行日期范围

时间:2013-04-03 20:13:30

标签: mysql sql

我有以下查询:

SELECT * FROM financials

如何将查询限制为过去30天内的日期?类似的东西:

SELECT * FROM financials WHERE date BETWEEN now - 30 days AND now

1 个答案:

答案 0 :(得分:3)

SELECT * FROM financials WHERE date >= NOW() - INTERVAL 30 DAY