#这个按照时间范围查询所有数据
SELECT * FROM `t_ordersetting` WHERE orderDate BETWEEN '2019-03-11' AND '2019-05-15'
#这个是查询本年本月所有数据
SELECT * FROM `t_ordersetting` WHERE DATE_FORMAT(orderDate,'%Y-%m')=DATE_FORMAT(NOW(),'%Y-%m')
#这个是查询指定年指定月的所有数据
SELECT * FROM `t_ordersetting` WHERE DATE_FORMAT(orderDate,'%Y-%m')=DATE_FORMAT('2019-03-11','%Y-%m')
12-02
6261
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)