查询某个表的字段被其他表作为外键

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/heyanfeng22/article/details/56013164
select c.table_name,
        c.constraint_name,
        fc.table_name,
        fc.constraint_name,
        cc.column_name,
        fcc.column_name
   from user_cons_columns fcc,
        user_cons_columns cc,
        user_constraints  c,
        user_constraints  fc
  where fc.constraint_name = c.r_constraint_name
    and fc.constraint_name = fcc.constraint_name
    and c.constraint_name = cc.constraint_name
    and c.constraint_type = 'R'
    and  fc.table_name in ('ITSM_PRO_INST_APPEND') 

猜你喜欢

转载自blog.csdn.net/heyanfeng22/article/details/56013164