select distinct TABLE_NAME
from INFORMATION_SCHEMA.KEY_COLUMN_USAGE
where TABLE_SCHEMA ='database_schema' and CONSTRAINT_name != 'PRIMARY'
MySQL 查询所有外键的表
最新推荐文章于 2024-10-05 07:35:11 发布
select distinct TABLE_NAME
from INFORMATION_SCHEMA.KEY_COLUMN_USAGE
where TABLE_SCHEMA ='database_schema' and CONSTRAINT_name != 'PRIMARY'