1 min read
Find columns by name across the schema

Here is one way to find which tables in a schema contain a certain column name in MYSQL.

SELECT COLUMN_NAME, TABLE_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME like '%mail%'
  AND TABLE_SCHEMA = 'company';

The results will look like this:

COLUMN_NAMETABLE_NAME
mailforms
mail_userforms
replymailshops