您现在的位置是:首页 >  云笔记 >  开发笔记 >  文章详情

Oracle查询数据库中所有的表和表注释名称

豆豆   2021-06-16 14:42:28   789人已围观

--查询用户表

select * from user_tables;

--查询用户表注释

select * from user_tab_comments;

--查询所有表

select * from all_tables t where t.owner in ('库名');

--查询所有表注释

select * from all_tab_comments t where t.owner in ('库名')

----查询所有表注释

select t.table_name,a.comments,t.num_rows from all_tables t left join all_tab_comments a on a.table_name = t.TABLE_NAME and t.owner in ('库名')

--查询所有表注释

select t.table_name,a.comments,t.num_rows from user_tables t left join user_tab_comments a on a.table_name = t.TABLE_NAME ;

--查询所有表中的列名称

select * from all_tab_columns;

--查询用户sequence

select * from user_sequences;

--查询系统所有 sequence

select * from all_sequences ;

--查询所有的主键

select * from   ALL_constraints where owner='SA';

--查询用户类主键

select * from   user_constraints where owner='SA';


分享到:

编辑发布时间:2021-06-16 14:42:28