Oracle查询用户所有表的语句_第1页
Oracle查询用户所有表的语句_第2页
Oracle查询用户所有表的语句_第3页
全文预览已结束

付费下载

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、select * from all_tab_comme nts-查询所有用户的表,视图等select * from user_tab_comme nts-查询本用户的表,视图等select * from all_col_comme nts-查询所有用户的表的列名和注释.select * from user_col_comme nts-查询本用户的表的列名和注释select * from all_tab_colum ns-查询所有用户的表的列名等信息(详细但是没有备注).select * from user_tab_colum ns-查询本用户的表的列名等信息(详细但是没有备注).-一般使用1:

2、selectt.table_ name,me nts from user_tab_comme nts t-一般使用2:select r1, r2, r3, r5from (select a.table_ name r1, a.colu mn_n ame r2, me nts r3fromuser_col_comme nts a),(selectt.table_ name r4, me nts r5 from user_tab_comme nts t)where r4 = r1以上就是oracle查询用户所有表的语句介绍。如何在oracle中查询所有用户表的表名、主

3、键名称、索引、外键等1、查找表的所有索引(包括索引名,类型,构成列): select t.*,i.i ndex_type from user_ in d_colum ns t,user_ in dexes i where t.i ndex_ name=i.i ndex_ name and t.table_ name = i.table_ name and t.table_ name =要查询的表2、查找表的主键(包括名称,构成歹 列):select cu.* from user_c on s_colum ns cu, user_c on stra ints au where cu.c on s

4、trai nt_name = au.c on strai nt_n ame and au.c on stra in t_type =P and au.table_ name =要查询的表3、查找表的唯一性约束(包括名称,构成歹歹):select colum n_n ame from user_c on s_colum ns cu, user_c on stra ints au where cu.con strai nt_n ame = au.c on strai nt_n ame and au.c on strai nt_type =U and au.table_ name = 要查询的表4、

5、查找表的外键(包括名称,引用表的表名和对应的键名,下面是分成多步查询):select * from user_constraints c where c.constraint_type =R and c.table_name = 要查询的表查询外键约束的列名:select * from user_c on s_colum ns cl where cl.c on strai nt_n ame =夕卜键名称查询引用表的键的列名:select * from user_c on s_colum ns cl where cl.c on strai nt_n ame =夕卜键引用表的键名5、查询表的所有列及其属要查询的性 select t.*,c.COMMENTS from user_tab_colum ns t,user_col_comme nts c where t.tab

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论