mysql>
select
from_unixtime(clock,
"%Y-%m-%d %H:%i"
)
as
DateTime,
sum
(round(value/1024/1024,2))
as
Traffic_total
from
history_uint
where
itemid
in
(58855,58860)
and
from_unixtime(clock)>=
'2014-09-20'
and
from_unixtime(clock)<
'2014-09-21'
group
by
from_unixtime(clock,
"%Y-%m-%d %H:%i"
) limit 20;
+
| DateTime | Traffic_total |
+
| 2014-09-20 00:00 | 4.23 |
| 2014-09-20 00:01 | 3.30 |
| 2014-09-20 00:02 | 2.25 |
| 2014-09-20 00:03 | 1.66 |
| 2014-09-20 00:04 | 1.10 |
| 2014-09-20 00:05 | 0.98 |
| 2014-09-20 00:06 | 1.35 |
| 2014-09-20 00:07 | 2.81 |
| 2014-09-20 00:08 | 1.45 |
| 2014-09-20 00:09 | 3.21 |
| 2014-09-20 00:10 | 3.11 |
| 2014-09-20 00:11 | 2.80 |
| 2014-09-20 00:12 | 2.68 |
| 2014-09-20 00:13 | 6.05 |
| 2014-09-20 00:14 | 5.21 |
| 2014-09-20 00:15 | 6.80 |
| 2014-09-20 00:16 | 7.60 |
| 2014-09-20 00:17 | 7.04 |
| 2014-09-20 00:18 | 7.81 |
| 2014-09-20 00:19 | 4.27 |
+
20
rows
in
set
(1.52 sec)