Home  >  Q&A  >  body text

Mysql多表查询问题

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

非常感谢!

大家讲道理大家讲道理2741 days ago1957

reply all(12)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 13:04:42

    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.

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 13:04:42

    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"
    

    reply
    0
  • Cancelreply