场景: 系统每天会生成一个mysql数据表,里面存储的当天的模块访问量,假设字段为pv。如何统计一个月的模块访问量呢?每个表的结构都是一样的。
非常感谢!
光阴似箭催人老,日月如移越少年。
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"
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