表:issue 字段:
id:1
time:2012-04-01 08:15:00
count:12
。。。。。
按小时统计count总数,结果如下
1 2012-04-01 8:00~9:00 134
2 2012-04-01 9:00~10:00 134
---------------------------
select DATE_FORMAT(time,'%Y-%m-%d %H:00'),sum(count)
from issue
group by DATE_FORMAT(time,'%Y-%m-%d %H:00')