码迷,mamicode.com
首页 > 数据库 > 详细

oracle查看表和列的描述

时间:2020-01-22 10:45:38      阅读:133      评论:0      收藏:0      [点我收藏+]

标签:prism   span   51cto   tar   database   注释   content   class   信息   

查看备注:

     --查看表的comment 
     select   *   from   all_tab_comments   where   table_name= upper(tablename) ;

     --查看列的comment 
     select   *   from   all_col_comments   where   table_name=upper(tablename) ;

 
 

下面为您介绍的语句用于实现oracle查询用户所有表,如果您对oracle查询方面感兴趣的话,不妨一看。

select * from all_tab_comments 
-- 查询所有用户的表,视图等

select * from user_tab_comments   
-- 查询本用户的表,视图等

select * from all_col_comments 
--查询所有用户的表的列名和注释.

select * from user_col_comments 
-- 查询本用户的表的列名和注释

select * from all_tab_columns 
--查询所有用户的表的列名等信息(详细但是没有备注).

select * from user_tab_columns 
--查询本用户的表的列名等信息(详细但是没有备注).

--一般使用1:
select t.table_name,t.comments from user_tab_comments t

--一般使用2:
select r1, r2, r3, r5
from (select a.table_name r1, a.column_name r2, a.comments r3
          from user_col_comments a),
       (select t.table_name r4, t.comments r5 from user_tab_comments t)
where r4 = r1

以上就是oracle查询用户所有表的语句介绍。

oracle查看表和列的描述

标签:prism   span   51cto   tar   database   注释   content   class   信息   

原文地址:https://www.cnblogs.com/scorates/p/12227906.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!