SELECT A.TABLE_NAME,B.COMMENTS TABLE_COMMENTS, ROW_NUMBER() OVER(PARTITION BY A.TABLE_NAME ORDER BY A.TABLE_NAME) AS RANK,
A.COLUMN_NAME, C.COMMENTS COL_COMMENTS, A.DATA_TYPE || '(' || A.DATA_LENGTH || ')' COLUMN_TYPE FROM USER_TAB_COLUMNS A LEFT JOIN USER_TAB_COMMENTS B ON A.TABLE_NAME = B.TABLE_NAME LEFT JOIN USER_COL_COMMENTS C ON A.TABLE_NAME = C.TABLE_NAME AND A.COLUMN_NAME = C.COLUMN_NAME