【oracle】根据某张表的字段查询此字段为主键的表名
--根据某张表的字段查询此字段为主键的表名
select cu.*,cu.owner || '.' || cu.table_name as "table_fullName"
from all_cons_columns cu
where cu.owner = '大写用户名' AND cu.column_name in ('大写列名') and cu.constraint_name in
(select au.constraint_name
from all_constraints au
where au.constraint_type = 'P' --P为主键
and au.owner = '大写用户名');