1、 查询一个表有多少列
select count(*) from user_tab_columns where table_name=upper('用户表') ;
用户表为你要查询的表名或视图名。
2、根据列明查找表名,可以查到表、视图、索引
select distinct table_name
from user_tab_columns t
where t.column_name like '%ID%' ;
ID为你要查询的字段。
其中, user_tab_columns 是Oracle 的一个系统视图。
3、获取表字段
select *
from user_tab_columns
where Table_Name='用户表'
order by column_name ;