Oracle查询简单数据字典SQL语句

SELECT TAB.*,COL.DATA_TYPE,COL.DATA_LENGTH
  FROM (SELECT TAB_COM.TABLE_NAME,
               TAB_COM.COMMENTS TAB_COMM,
               COL_COM.COLUMN_NAME,
               COL_COM.COMMENTS COL_COMM
          FROM USER_TAB_COMMENTS TAB_COM
          LEFT JOIN USER_COL_COMMENTS COL_COM ON TAB_COM.TABLE_NAME =
                                                 COL_COM.TABLE_NAME
         WHERE TAB_COM.TABLE_TYPE = 'TABLE') TAB
  LEFT JOIN USER_TAB_COLUMNS COL ON TAB.TABLE_NAME = COL.TABLE_NAME
                                AND TAB.COLUMN_NAME = COL.COLUMN_NAME

你可能感兴趣的:(oracle,sql,comments,join,user,table)