Mysql多表查询问题
大家讲道理
大家讲道理 2017-04-17 13:02:42
0
12
2074

场景:
系统每天会生成一个mysql数据表,里面存储的当天的模块访问量,假设字段为pv。如何统计一个月的模块访问量呢?每个表的结构都是一样的。

非常感谢!

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(12)
洪涛

For log data like this, I recommend using a nosql database such as mongodb. Nowadays, the combination of mysql and mongodb is a very common solution.

伊谢尔伦

Using the information_schema library to query tables is stress-free

SELECT SUM(TABLE_ROWS) FROM information_schema.`TABLES` WHERE TABLE_NAME LIKE "pv_%"  AND LEFT(CREATE_TIME, 10)="2015-05-07"
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template