The problem of mysql horizontal subtable

if you currently need to generate a table each month to store the current month"s data, the following table will be generated:

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

so the question is: how to count the total data from 2017 to 2018?

Mar.01,2021

select gives the total data for each table from 17 to 18 years, and then the sum in memory is the total data from 2017 to 2018.

Menu