Oracle 查询所有表之间的主外键关系
select a.constraint_name, a.table_name, b.constraint_name from user_constraints a, user_constraints b where a.constraint_type = 'R' and b.constraint_type = 'P' and a.r_constraint_name = b.constraint_name P 代表主键 R 代表外键 ---------------------------------------------------------------------------------------------- Oracle 查看一个表对应的主键和外键的约束关系,查看的语句: select a.owner 主键拥有者 ,a.table_name 主键表