Answer the question
In order to leave comments, you need to log in
How to make a selection from tables with the same structure?
Hey!
There are several tables with the same structure but different names.
it is necessary to make a selection from all tables.
Everything is simple if the names of the tables are known, you can use union, but the tables appear dynamically.
You can select the table names that I need:
SELECT table_name FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME LIKE 'need_table_%'
Answer the question
In order to leave comments, you need to log in
So-so idea to dynamically form tables, and then get decent hemorrhoids to deal with these tables.
What you need is written here in the documentation.
But what prevented you from placing all the data in one table, and what you use as an addition to the name of your individual tables is simply stored in an indexed column?
It's just that if you can't find a solution to such a simple question, chances are that you made a mistake earlier when choosing such a controversial architectural decision to dynamically create the same type of tables.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question