1,105,384 Community Members

Mysql Query multiple Databases

Member Avatar
RazorRamon
Junior Poster in Training
79 posts since Sep 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

hello,

I have a situation that i'm wondering if there's a solution. I have specific databases for different cities in texas. I plan on adding more but i do not nkow how many more or what their names will be. Every city is going to have the same tables in them. I want to UNION all the similar tables in every database. Is it possible to query every database.specifictable without knowing the names of all of the databases yet.

Thanks in advance

Member Avatar
pritaeas
mod_pritaeas
11,315 posts since Jul 2006
Reputation Points: 1,420 [?]
Q&As Helped to Solve: 1,835 [?]
Skill Endorsements: 156 [?]
Moderator
Featured
Sponsor
 
0
 

You can build your query, based on the output of the SHOW DATABASES query. Note that this can get real slow.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: