怎么样在oracle中查询已建好的表(acctinfo)的主键?用语句查询??

[复制链接]
查看11 | 回复3 | 2011-1-27 15:43:02 | 显示全部楼层 |阅读模式
select column_name from user_constraintsc,user_cons_columnscol where c.constraint_name=col.constraint_name and c.constraint_type='P' and c.table_name='acctinfo'
回复

使用道具 举报

千问 | 2011-1-27 15:43:02 | 显示全部楼层
查找表的主键(包括名称,构成列):select cu.* from user_cons_columns cu, user_constraints au where cu.constraint_name = au.constraint_name and au.constraint_type = 'P' and au.table_name = 'acctin
回复

使用道具 举报

千问 | 2011-1-27 15:43:02 | 显示全部楼层
select * from user_constraints where table_name = 'acctinfo' and constraint_type = 'P'
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行