Home >Database >Mysql Tutorial >mysql按时间分段统计数据

mysql按时间分段统计数据

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 09:35:021145browse

mysql

表结构:
+----------------+--------------+
| time | num |
+----------------+--------------+
| 1256278360 | 10000000 |
| 1256278370 | 10000000 |
| 1256278380 | 10000000 |
| 1256278390 | 10000000 |
| 1256278480 | 10000000 |
| 1256278490 | 10000000 |
| 1256278580 | 10000000 |
| 1256278590 | 10000000 |
| 1256278600 | 10000000 |
| 1256278670 | 10000000 |
| 1256278680 | 10000000 |
| 1256278690 | 10000000 |
| 1256279810 | 10000000 |
| 1256279820 | 10000000 |
| 1256279830 | 10000000 |
| 1256279840 | 10000000 |

如何查询time字段每隔15秒/30秒/1分钟段的sum值,也就是汇总时间段内多条数据为一条,可以将数据库分段,可就是不知道该怎么分,求大神指导...

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn