Oracle 查询表字段相关信息

-- 查询表的所有字段
select *
from user_tab_comments
where TABLE_NAME = 'xx';
select *
from user_col_comments
where TABLE_NAME = 'xx';
select *
from ALL_TAB_COLUMNS
where TABLE_NAME = 'xx';


select  t1.TABLE_NAME,t1.COLUMN_NAME,t1.COMMENTS,t2.DATA_TYPE,t2.DATA_LENGTH
      from  user_col_comments t1
left join ALL_TAB_COLUMNS t2
on t1.TABLE_NAME = t2.TABLE_NAME and t1.COLUMN_NAME=t2.COLUMN_NAME
where t1.TABLE_NAME='xx'
order by t2.column_id;


 

posted @ 2022-10-26 17:17  D·Felix  阅读(72)  评论(0编辑  收藏  举报