您当前位置:优侠库 > 资讯攻略 >
来源:未知
2021-05-26 07:20:14 浏览: 分类:资讯攻略

oracle根据外键名查关联的表

1.查找表的所有索引(包括索引名称、类型和组成列):

T.*,I . index _ type from user _ ind _ columns t,user _ indexes I其中t. index _ name = I. index _ name和t. table _ name = I. table _ name和t. table _ name =要查询的表。

2.查找表的主键(包括构成列的名称):

选择Cu。* from user _ cons _ columnscu,user _ constraints au其中Cu . constraint _ name = au . constraint _ name,au.constraint _ type =' p ',au.table _ name =要查询的表。

3.查找表的唯一性约束(包括名称、构成列):

select _ name from user _ cons _ columns Cu,user _ constraints au其中Cu . constraint _ name = au . constraint _ name,au.constraint _ type =' u ',au.table _ name =要查询的表。

4.查找表的外键(包括名称、引用表的表名和对应的键名。以下是一个多步查询):

Select * from user _ constraints c其中c.constraint _ type =' r ',c.table _ name =要查询的表。

外键约束的查询列名:

Select * from user _ cons _ columnscl其中cl。constraint _ name =外键名

引用表的键的列名:

Select * from user _ cons _ columnscl其中cl。constraint _ name =外键引用表的键名。

5.查询表中的所有列及其属性。

Select t. *,c . comments from user _ tab _ columns t,user _ col _ comments c其中t.table _ name = c.table _ name,t.column _ name = c.column _ name,t.table _ name =要查询的表。......

关键词:甲骨文

优侠库网站每天提供最新最热门的安卓手机软件、游戏下载、分享热门手游资讯攻略教程、手机软件教程步骤,专注安卓手机游戏软件下载。

本文链接:http://www.123down.cn/gonglue/227133.html

攻略资讯
安卓软件
安卓游戏