鍍金池/ 問答/PHP  數(shù)據(jù)庫/ mysql水平分表問題

mysql水平分表問題

假如目前需要每個月生成一張表來存儲當(dāng)月的數(shù)據(jù)會有如下的表產(chǎn)生:

tablename_201709
tablename_201710
tablename_201711
tablename_201712
tablename_201801
tablename_201802
tablename_201803
tablename_201804
.......

那么問題是:如何來統(tǒng)計2017年到2018年的數(shù)據(jù)的總量?

回答
編輯回答
玩控

select出 17年 至 18年 每張表的數(shù)據(jù)總量,然后內(nèi)存中求出總和不就是 2017年到2018年的數(shù)據(jù)的總量 么?

2018年8月4日 21:31