Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Which cols are part of the primary key?
Hi,
1 select a.owner,a.constraint_name,a.table_name,a.column_name
2 from user_cons_columns a, user_constraints b
3 where a.constraint_name=b.constraint_name
4* and b.constraint_type='P'
SQL> /
OWNER CONSTRAINT_NAME TABLE_NAME
COLUMN_NAME
---------- -------------------- ------------------------------ --------------- SCOTT PK_DEPT DEPT DEPTNO SCOTT PK_EMP EMP EMPNO
SQL> Regards,
Arian Received on Mon Mar 20 2006 - 08:46:36 CST