select a.constraint_name as fk,
a.table_name as tname,
b.constraint_name as pk
from user_constraints a, user_constraints b
where a.constraint_type = 'R'
and b.constraint_type = 'P'
and a.r_constraint_name = b.constraint_namesql
这里记得用as一下别名,否则外层嵌套select查询语句,会报列未定义。table
完整的以下:select
select t.*
from (select a.constraint_name as fk,
a.table_name as tname,
b.constraint_name as pk
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) t
where t.tname = 'T_PUB_OPTION'im
2、知道表名了,能够新建一个图表窗口(英文版的pl/sql是Diagram Window),而后把有关系的表拖到该视图中。以下:图表