转自:https://my.oschina.net/u/3783799/blog/2870207
1.oracle 查询当前用户下的表名,表注释
select t.table_name, f.comments
from user_tables t
inner join user_tab_comments f
on t.table_name = f.table_name
2.oracle 查询某表的所有字段,字段注释,字段类型
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.查询某张表下的所有字段
select t.COLUMN_NAME
from USER_TAB_COLUMNS t
where t.TABLE_NAME = upper('表名')