select column_name from all_cons_columns cc
where owner='SSH' --SSH为用户名称,要注意大小写
and table_name='SYS_DEPT' --SYS_DEPT为表名,注意大小写
and exists (select 'x' from all_constraints c
where c.owner = cc.owner
and c.constraint_name = cc.constraint_name
and c.constraint_type ='P'
)
order by position
;
在ORACLE得到某个表的主键字段名
最新推荐文章于 2023-03-20 11:30:53 发布