oracle查询表中所有字段

爷,独闯天下 提交于 2019-11-30 00:21:10

 

 

查询表中所有字段


-- 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 ('字段名','字段名');

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!