I have a table that lists the names of the databases that have tables with the same schema. Each customer has a different database.
Is there a way to run a select on same table in multiple databases?
The first query I wrote was to get a list of databases concatenated the table name.
Select concat(database_name,'.','TableA') from dbnamelist
This results in output like
database1.TableA
database2.TableA
Now I want to select a value in the column type but across different tables.
Select type from database1.TableA,database2,TableA
Is it possible to do this in a single SQL statement?