0


请帮助加快查询以选择当前表上引用的所有表名和列名,如果我无法更改数据库规则和结构
谢谢

SELECT 
  DISTINCT AC.table_name, ACC.column_name  
FROM 
  all_constraints AC 
  INNER JOIN all_cons_columns ACC 
    ON ACC.table_name = AC.table_name 
       AND  
       ACC.constraint_name = AC.constraint_name  
WHERE 
  AC.r_constraint_name IN  (
    SELECT AC.constraint_name 
    FROM all_constraints AC 
    WHERE 
     table_name='CURRENT_TABLE' 
     AND 
     owner='SOME_DATABASE_NAME'
  )
4

0 回答 0