-- 列转行
select * from Tt_Columu;
Select T1.t_Name,
Decode(a.l_No, 1, '语文', 2, '数学', 3, '英语', 4, '音乐') Course,
Decode(a.l_No,
1,
T1.t_Chinese,
2,
T1.t_Math,
3,
T1.t_English,
4,
T1.t_Music) Fenshu
From Tt_Columu T1, (Select Level l_No From Dual t Connect By Level < 5) a;
-- 与虚表的结合使用,避免了行数据的e的n次方增加。切记要谨慎使用。