Find all tables in MySQL database containing specific column names


/ Published in: MySQL
Save to your folder(s)



Copy this code and paste it in your HTML
  1. SELECT DISTINCT TABLE_NAME
  2. FROM INFORMATION_SCHEMA.COLUMNS
  3. WHERE COLUMN_NAME IN ('columnA','ColumnB')
  4. AND TABLE_SCHEMA='YourDatabase';

URL: http://stackoverflow.com/questions/193780/how-to-find-all-the-tables-in-mysql-with-specific-column-names-in-them

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.