There is such a task: through information_schema.tables to get a list of tables that satisfy a given condition. Then make a SELECT query to the combined set of those tables that are included as tuples in the previously obtained representation. Example:
SELECT TABLE_NAME
FROM information_schema.tables
WHERE table_schema='my_scheme';
Conditional result:
table1
table2
table3
Now I need to write code that would be equivalent to the query:
SELECT attribute1
FROM table1, table2, table3