SQL Return 包含与主键相关的外键的表列表

SQL Return list of tables containing foreign keys related to a primary key

我正在尝试查询 mySQL 数据库以 return 包含与主键关联的外键的 table 列表。例如,我有一个 table 包含 "reference_number" 和其他 table 包含 "reference_number" 作为外键。我如何查询数据库以 return 包含 "reference_number" 作为外键的 table 列表?谢谢。

可能重复:

MySQL: How to I find all tables that have foreign keys that reference particular table.column AND have values for those foreign keys?

一个可能的解决方案是:

USE information_schema;
SELECT *
FROM
  KEY_COLUMN_USAGE
WHERE
  REFERENCED_TABLE_NAME = 'your_table'
  AND REFERENCED_COLUMN_NAME = 'reference_number';