mysql 查询当日,昨日,当月,当季度,上一季度和当天某一时间段的数据

test:表名 CreateDateTime:时间字段名 1. 获取当日的数据 select * from test where to_days(CreateDateTime)= to_days(now()) 2. 获取昨日的数据 select * from test where to_days(now())-todays(CreateDateTime) <=1 3. 获取当月的数据 select
相关文章
相关标签/搜索