oracle中所有表的字段和注释

select
     t1.owner
    ,t1.table_name
    ,t1.column_id
    ,t1.column_name
    ,t1.data_type
    ,t2.comments
from all_tab_columns t1
join all_col_comments t2
    on t1.owner = t2.owner
        and t1.table_name  = t2.table_name 
        and t1.column_name = t2.column_name
where t1.owner not like '%SYS%'
;
select
     t1.owner
    ,t1.table_name
    ,t3.comments as table_comment
    ,t3.table_type
    ,t1.column_id
    ,t1.column_name
    ,t1.data_type
    ,t2.comments as column_comment
from all_tab_columns t1
join all_col_comments t2
    on t1.owner = t2.owner
        and t1.table_name  = t2.table_name 
        and t1.column_name = t2.column_name
join all_tab_comments t3
    on t1.owner = t3.owner
        and t1.table_name  = t3.table_name 
where t1.owner not like '%SYS%'
;
原文地址:https://www.cnblogs.com/chenzechao/p/9565678.html