oracle列别名查询
答案:3 悬赏:50 手机版
解决时间 2021-01-23 02:03
- 提问者网友:像風在裏
- 2021-01-22 19:06
oracle列别名查询
最佳答案
- 五星知识达人网友:何以畏孤独
- 2021-01-22 19:55
可以用类似如下写法来实现
select year,
max(decode(month,1,amount,null)) as m1,
max(decode(month,2,amount,null)) as m2,
max(decode(month,3,amount,null)) as m3,
max(decode(month,4,amount,null)) as m4
from TTrans
group by year
order by year
select year,
max(decode(month,1,amount,null)) as m1,
max(decode(month,2,amount,null)) as m2,
max(decode(month,3,amount,null)) as m3,
max(decode(month,4,amount,null)) as m4
from TTrans
group by year
order by year
全部回答
- 1楼网友:掌灯师
- 2021-01-22 21:10
11.2 之后可以直接使用
SELECt listagg(rav.amount , ' ') within GROUP(ORDER BY rav.month)
FROM TTrans rav;
SELECt listagg(rav.amount , ' ') within GROUP(ORDER BY rav.month)
FROM TTrans rav;
- 2楼网友:鸠书
- 2021-01-22 21:03
讲查询结果显示形式改变,就像2楼说的!!
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯