Oracle查询所有表的字段明细

SELECT USER_TAB_COLS.TABLE_NAME   as 表名,
       UTC.COMMENTS               as 表中文名,
       USER_TAB_COLS.COLUMN_ID    as 列序号,
       USER_TAB_COLS.COLUMN_NAME  as 列名,
       USER_TAB_COLS.DATA_TYPE    as 数据类型,
       USER_TAB_COLS.DATA_LENGTH  as 长度,
       USER_TAB_COLS.NULLABLE     as 是否为空,
       user_col_comments.comments as 备注
      
  FROM USER_TAB_COLS
  left join user_tab_comments utc
    on USER_TAB_COLS.TABLE_NAME = utc.table_name
 inner join user_col_comments
    on user_col_comments.TABLE_NAME = USER_TAB_COLS.TABLE_NAME
   and user_col_comments.COLUMN_NAME = USER_TAB_COLS.COLUMN_NAME order by 表名,列序号

 

posted @ 2017-10-16 15:13  夏日浅笑、  阅读(2680)  评论(0编辑  收藏  举报