mysql 查询主键外键

 

select
    TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME
from INFORMATION_SCHEMA.KEY_COLUMN_USAGE
where CONSTRAINT_SCHEMA ='autogen_rbac' AND
    TABLE_NAME = 't_autogen_role';

  

 

posted @ 2020-01-07 18:01  GordonDicaprio  阅读(375)  评论(0编辑  收藏