当前位置: 代码迷 >> Oracle开发 >> 怎么用一条sql语句查看所有表的注释
  详细解决方案

怎么用一条sql语句查看所有表的注释

热度:32   发布时间:2016-04-24 07:17:20.0
如何用一条sql语句查看所有表的注释?
在一个用户下,如何查看所有表下的注释?
如:
select table_name,table_type,comments from cat;

可是这条语句不对。

------最佳解决方案--------------------
查用户所有的表:
select * from all_tables t where t.owner='';
查表的注释:
select * from user_tab_comments t where t.table_name='Y_TEST2';
查字段的注释:
select * from user_col_comments t where t.table_name='Y_TEST2';

三者结合起来试试。
------其他解决方案--------------------
' ;' FROM user_tables

------其他解决方案--------------------
SELECT 'desc '
------其他解决方案--------------------
用如下方法可以查出该用户下所有的表:
select table_name,table_type from cat;

但如何才能查看所有表下的注释呢?


------其他解决方案--------------------
select * from user_col_comments;能查出字段的所有注释
------其他解决方案--------------------
该回复于2012-11-23 13:35:01被管理员删除
------其他解决方案--------------------
cat 就没有 comments 这个字段
------其他解决方案--------------------
table_name 
  相关解决方案