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 ('字段名','字段名');
发布了57 篇原创文章 · 获赞 10 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/zh_1721342390/article/details/89672731