oracle數據庫中的查詢主鍵外鍵的約束

select a.constraint_name 外鍵名, a.table_name 外鍵表, b.constraint_name 主鍵名, b.table_name 關聯主鍵表
from user_constraints a, user_constraints b
where  b.table_name='PRODUCT' and a.constraint_type = 'R'  and b.constraint_type = 'P'  and a.r_constraint_name = b.constraint_name

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章