-1

Possible Duplicate:
How to find all the tables in MySQL with specific column names in them?

I want to select tables from sql where the table has a column named "TimeStamp". How do I list all the tables where those tables that will be selected has a column named "TimeStamp" in it? I am using MySQL.

Community
  • 1
  • 1
John
  • 836
  • 2
  • 25
  • 39

1 Answers1

4
SELECT TABLE_NAME 
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE COLUMN_NAME = 'timestamp'
      AND TABLE_SCHEMA='YourDatabase';

Done and done.

Source

Community
  • 1
  • 1
David
  • 3,831
  • 2
  • 28
  • 38