oracle查询表中所有字段

 

 

查询表中所有字段


-- user_tab_columns 自定义的字段
SELECT column_name FROM user_tab_columns where table_name = upper('表名') 

-- user_tab_cols 包含oracle创建的隐藏字段
SELECT column_name FROM user_tab_cols where table_name = upper('表名') 

 

将表所有列名查出,并拼成字符串

select Listagg(column_name, ',') WITHIN GROUP(ORDER BY column_name)
from user_tab_columns 
where table_name = upper('表名') 
--不想查询的字段名
and column_name not in ('字段名','字段名');

 

你可能感兴趣的:(oracle查询表中所有字段)