Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query All Tables in Database

Status
Not open for further replies.

dagoat10

Programmer
Jun 3, 2010
74
US
is there a way to query all the tables in mysql database. Rather than just listing all the tables in the query

Something like:
SELECT * from *.*;

I have a feeling there is a way but i can't remember
 
there is no easy way to do what you're asking

to begin with, you don't really want to retrieve all possible columns for all possible rows, right?

that would be like dumping the entire contents of the database

can you be more spcific about what you want?

r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
 
True it's more like one of these:

Select Name from *.*;

Or

Select Name from (like=%);
 
Cause I have 40 tables with the same column that I want to retrive
 
I have 40 tables with the same column
the bad news is that you need to write a separate SELECT statement for each table


the good news is that you can combine them with UNION

why do you have 40 tables with the same column? i have the feeling they should maybe be just one table

r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top