1 纵表平铺
1.1 原数据
1.2 平铺
结果:每个班级按照年龄从小到大平铺为一行
select * from (select rt.class, row_number() over(partition by rt.class order by rt.age) row_num, rt.sno, rt.sname from rank_test rt order by rt.class, rt.age) pivot(max(sno) sno, max(sname) as sname for row_num in('1' as sno1, '2' as sno2, '3' as sno3, '4' as sno4))
原文链接:https://blog.csdn.net/m0_37253968/article/details/120410191
标签:rt,平铺,sname,sno,组内,转列,Oracle,class,row From: https://www.cnblogs.com/daytoy105/p/17783190.html