oracle查询主键
时间: 2023-08-19 20:13:51 浏览: 236
主键约束-[feiq]Oracle数据库
要查询Oracle数据库中的主键,可以使用以下SQL语句:
SELECT OWNER, TABLE_NAME
FROM DBA_TABLES A
WHERE EXISTS (SELECT *
FROM DBA_CONSTRAINTS B
WHERE A.TABLE_NAME = B.TABLE_NAME
AND B.CONSTRAINT_TYPE = 'P')
AND OWNER IN ('SYS');
这个查询语句会返回所有具有主键约束的表的所有者和表名。\[2\]
#### 引用[.reference_title]
- *1* *2* *3* [oracle查询主键和唯一索引的表](https://blog.csdn.net/Auspicious_air/article/details/122924842)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文