반응형
SELECT A.TABLE_NAME
, A.CONSTRAINT_NAME
, B.COLUMN_NAME
, B.POSITION
FROM ALL_CONSTRAINTS A
, ALL_CONS_COLUMNS B
WHERE A.TABLE_NAME = 'A'
AND A.CONSTRAINT_TYPE = 'P'
AND A.OWNER = B.OWNER
AND A.CONSTRAINT_NAME = B.CONSTRAINT_NAME
ORDER BY B.POSITION
반응형