选择出的信息结果:表名 说明
select user_tab_comments.table_name as 表名,user_tab_comments.comments as 说明 from user_tab_comments
选择出的信息结果:表名(备注)、列名、列标注、主键、外键、字段类型、长度、小数位数、是否允许空、默认值
select case when user_tab_comments.comments is null then a.table_name else a.table_name||'('||user_tab_comments.comments||')' end as 表名(备注), a.column_name as 列名, f.comments as 列标注, decode(e.key1, 'P', '√', '') as 主键, decode(e.key2, 'R', '√', '') as 外键, a.data_type as 字段类型, NVL(decode(a.data_type, 'NUMBER', a.data_precision, a.data_length),0) as 长度, NVL(a.data_scale,0) as 小数位数, a.nullable as 是否为空, a.data_default as 默认值 from user_tab_columns a, user_col_comments f, user_tab_comments, ( select uc.table_name, uc.constraint_name, ucc.column_name, uc.constraint_type key1, uc.constraint_type key2 from user_constraints uc, user_cons_columns ucc where (uc.constraint_type='R'or uc.constraint_type='P') and uc.constraint_name=ucc.constraint_name and uc.owner=ucc.owner and uc.table_name=ucc.table_name and ucc.table_name not like 'BIN$%==$0' ) e where a.table_name = e.table_name(+) and a.column_name = e.column_name(+) and a.table_name = f.table_name and a.column_name = f.column_name and a.table_name = user_tab_comments.table_name and a.table_name not like 'BIN$%==$0' order by a.table_name