📜  oracle 列表约束 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:34.599000             🧑  作者: Mango

代码示例1
SELECT *
FROM ALL_CONSTRAINTS c,
     ALL_CONS_COLUMNS cols
WHERE c.CONSTRAINT_TYPE = 'P'
  AND c.CONSTRAINT_NAME = COLS.CONSTRAINT_NAME
  AND c.OWNER = COLS.OWNER
  AND c.OWNER = 'schema_name'
  AND cols.TABLE_NAME = 'table_name'
ORDER BY cols.TABLE_NAME, COLS.POSITION;