查询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'

相关文章: