如语句:select u_account,state.sum(render_money) sum_money,count(render_money) count_money from table t group by u_account,state order by u_account
得到的结果集,现在想获得表头字段名称。
在Oracle中,想通过查询语句得出结果集,获得该结果集的表头。
答案:3 悬赏:0
解决时间 2021-04-08 01:01
- 提问者网友:控制庸俗
- 2021-04-07 10:08
最佳答案
- 二级知识专家网友:我颠覆世界
- 2021-04-07 10:43
查询数据字典获取列名信息:
select * from user_tab_columns where table_name = your_table_name
用存储过程把纵向的列名转为横向的列名串,然后与数据合起来,这一步自己想了
select * from user_tab_columns where table_name = your_table_name
用存储过程把纵向的列名转为横向的列名串,然后与数据合起来,这一步自己想了
全部回答
- 1楼网友:duile
- 2021-04-07 11:29
你好!
select u_account,state.sum(render_money) sum_money,count(render_money) count_money from table t where 1=0 group by u_account,state order by u_account
希望对你有所帮助,望采纳。
- 2楼网友:眠于流年
- 2021-04-07 11:16
这个你可以自己用union all并一个表头呀,直接跟结果集一起不就OK了吗,其它方式我还没尝试过,如果你有好的方法给我借鉴下,呵呵。
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯