Feb 18, 2021 08:39 AM|PatriceSc|LINK
You first query could generate a SELECT statement for each table ie SELECT CONCAT('SELECT .. FROM ',table_name) etc... and then use StingJ.Join to concat those statements with "UNION ALL" in between.
Or if you want to do all on the MySQL side you could sue GROUP_CONCAT to do the same thing and then use EXECUTE to run the resulting statement.
I understand you don't have control on the db but another option could be to expose that through a view '(that you'll need to update each year) unless tables are created in advance.
You have also partioned tables allowing to handle this kind of schema deisgn