oracle query table name of the current user can be seen, corresponding to the table all the fields in the original

Transfer: https://my.oschina.net/u/3783799/blog/2870207

1.oracle lookup table name in the current user, table comments

select t.table_name, f.comments
  from user_tables t
 inner join user_tab_comments f
    on t.table_name = f.table_name

All fields 2.oracle query a table, field notes, field type

SELECT a.TABLE_NAME, a.COLUMN_NAME, a.DATA_TYPE, b.COMMENTS
  FROM USER_TAB_COLUMNS a
  LEFT JOIN USER_COL_COMMENTS b
    ON a.table_name = b.table_NAME
   AND a.COLUMN_NAME = b.COLUMN_NAME

3. Query All fields in a particular table

select t.COLUMN_NAME
  from USER_TAB_COLUMNS t
 where t.TABLE_NAME = upper('表名')

Guess you like

Origin www.cnblogs.com/sharpest/p/11514783.html