mysql 查询时间段每分 小时 天的统计数据

// 查询8月份某个用户的开单的数量
select
DATE_FORMAT(create_datetime,'%Y-%m-%d') as datetime,count(id_account) as num where id_account=account_id and create_datetime>='2014-08-01 0:0:0' and create_datetime<='2014-08-31 23:59:59' group by DATE_FORMAT(create_datetime,'%d')

 

posted @ 2014-09-01 16:26  page wang  阅读(158)  评论(0)    收藏  举报