erzoolander
asked on
Select * FROM all tables? MySQL
I've got a database I'm working with where there's an ever expanding number of tables - associated by a specific row (let's call it "blah").
Instead of doing joins - is there syntax for me to basically say...
"SELECT * FROM all tables
WHERE blah = 'whatever'
?
Instead of doing joins - is there syntax for me to basically say...
"SELECT * FROM all tables
WHERE blah = 'whatever'
?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SELECT blah FROM Table1
WHERE blah = 'whatever'
will work.
If there another table with field blah, then use:
SELECT blah FROM Table1 Union
SELECT blah FROM Table2
WHERE blah = 'whatever'
and so on.
There is a way to query system tables to get the names and the [blah]s exist in the database and then design a proc to search for the information you need.
Mike