mysql find all tables with field name code example
Example 1: mysql find tables with column name
SELECT DISTINCT TABLE_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME IN ('columnA','ColumnB')
AND TABLE_SCHEMA='YourDatabase';
Example 2: mysql select all table that have field names
SELECT DISTINCT
TABLE_NAME
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE
COLUMN_NAME IN('column1', 'column2')
AND TABLE_SCHEMA = 'schema_name';