在Linux环境下,oracle数据库中查询表主键、外键及索引的命令是什么?
答案:2 悬赏:80
解决时间 2021-02-21 08:59
- 提问者网友:挣扎重来
- 2021-02-20 10:05
不清楚各对应的字段名
最佳答案
- 二级知识专家网友:颜值超标
- 2021-02-20 10:24
要通过查询ORACLE的数据字典才能知道。
1、查主键名称:
select * from user_constraints
where table_name = 'ART'
and constraint_type ='P';
查主键对应的列:
select * from user_cons_columns
where table_name = 'ART'
and constraint_name = 'PK_ART';
2、查索引名称:
select * from user_indexes
where table_name = 'ART';
查索引对应的列:
select * from user_ind_columns
where table_name = 'ART'
and index_name = 'INDX_BA';
1、查主键名称:
select * from user_constraints
where table_name = 'ART'
and constraint_type ='P';
查主键对应的列:
select * from user_cons_columns
where table_name = 'ART'
and constraint_name = 'PK_ART';
2、查索引名称:
select * from user_indexes
where table_name = 'ART';
查索引对应的列:
select * from user_ind_columns
where table_name = 'ART'
and index_name = 'INDX_BA';
全部回答
- 1楼网友:一个很哇塞的汉子
- 2021-02-20 10:37
我。。知。。道
加。。我。。私。。聊
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯