I have a mySQL with a few database instances. Each database is identical with the same table structure but different data stored.
For example:
Database db1 has a table db1.client and columns db1.client.Id, db1.client.Name, db1.client.Address
Database db2 has a table db2.client and columns db2.client.Id, db2.client.Name, db2.client.Address
Database db3 has a table db3.client and columns db3.client.Id, db3.client.Name, db3.client.Address
I would like to query and list every single database and display the name and address for each respective client table.
How do I do this?
Are they all in different databases, or different tables within the one database?
If the latter, you can use
UNIONto string your queries together, e.g.If the former (each table is in a different database) you will have to modify with database names as such: