jk's notes
  • Oracle 查询表结构

Oracle 查询表结构

select 
	a.column_name as "字段名称(英文)"
	, b.comments as "字段名称(中文)"
	, a.data_type as "数据类型"
	, a.data_length as "字段长度"
	, case(a.nullable) when 'N' then '否' else '是' end as "是否为空" 
from 
	user_tab_cols a 
	left join 
	user_col_comments b 
	on a.table_name = b.table_name 
	and a.column_name = b.column_name 
where 
	a.table_name = '<表名>' 
order by 
	a.column_id;
Last Updated:
Contributors: jk