MySQL中查询某年某月的数据
查询2020年的数据:
select * from day_rate where year(时间字段)='2020'
查询2月份的数据:
select * from day_rate where month(时间字段)='02'
查询2020年2月份的数据:
select * from day_rate where year(时间字段)='2019' and month(时间字段)='02'
select * from day_rate where year(时间字段)='2020'
select * from day_rate where year(时间字段)='2019' and month(时间字段)='02'