List:General Discussion« Previous MessageNext Message »
From:Frank Date:June 8 2006 1:48am
Subject:Re: How to find matching tables that have specific field name.
View as plain text  
William Scott wrote:

> Dear Sir,
>    
>   I have a database with over 80 tables.  Is there an easy way to find
>   table names that has PERSON_ID field using SELECT query?
>    
>   Thanks in advance for any help.
>    
>    
Hi Scott,

if you are using version 5.0 or higher, you can query the schema tables in
the information_schema database:
http://dev.mysql.com/doc/refman/5.0/en/information-schema.html

In case you are using an older version, you need to issue a "show tables"
query, iterate over all the tables, execute a "describe TABLE" statement
for each and parse the output.

Cheers
Frank

Thread
How to find matching tables that have specific field name.William Scott8 Jun
  • Re: How to find matching tables that have specific field name.Douglas Sims8 Jun
  • Re: How to find matching tables that have specific field name.Frank8 Jun