//查询当天的记录
> select COUNT(*) from `user` where date(createDate) = curdate()
//查询上一天
select COUNT(*) from `user` where date(createDate) = curdate()-1
//查询当前月份
select count(*) from orders where date_format(createDate,'%Y-%m')=date_format(now(),'%Y-%m')
//查询上个月的
select * from orders where date_format(createDate,'%Y-%m')=date_format(DATE_SUB(curdate(), INTERVAL 1 MONTH),'%Y-%m')
//查询本周的
SELECT * FROM 表 WHERE datediff(week,[dateadd],getdate())=0