1、查找一个表的主键和索引极其它们的字段
- 查主键名称:
select CONSTRAINT_NAME from user_constraints where table_name ='abc' and constraint_type ='P';
查主键对应的列:
select COLUMN_NAME from user_cons_columns where table_name = 'abc' and constraint_name = 'PK_ART'; -
查索引名称:
select INDEX_NAME from user_indexes where table_name = 'abc' ;
查索引对应的列:
select COLUMN_NAME from user_ind_columns where table_name = 'abc' and index_name = 'INDX_BA';