MySQL查询字段在哪个表

查询pwd字段在哪个数据库哪个表

1
2
3
4
5
6
7
SELECT
TABLE_SCHEMA,
TABLE_NAME
FROM
information_schema.`COLUMNS`
WHERE
COLUMN_NAME = 'pwd'

查询pwd字段在ERP数据库的哪个表

1
2
3
4
5
6
7
8
SELECT
TABLE_SCHEMA,
TABLE_NAME
FROM
information_schema.`COLUMNS`
WHERE
COLUMN_NAME = 'pwd'
AND TABLE_SCHEMA = 'ERP'