血翼残飞

导航

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'

posted on 2020-05-02 16:41  血翼残飞  阅读(6569)  评论(0)    收藏  举报