------解决方案-------------------- 11g以下的版本,写起来代码比较多:
select year y,
sum(decode(month, 1, amount)) m1,
sum(decode(month, 2, amount)) m2,
sum(decode(month, 3, amount)) m3,
sum(decode(month, 4, amount)) m4
from t
group by year ------解决方案--------------------