Mysql按小时,按日,按周,按月,按季度,按年分组统计数据
按小时:select from_unixtime(create_time,"%Y%m%d%H") as hours,count(id) as counts from table group by hours;按日:select from_unixtime(create_time,"%Y-%m-%d") as days,count(id) as counts from table group by ...