YEAR MO SAL
---- -- ----------
1992 1 1234
1992 2 1234
1993 1 1234
1993 2 1234
1994 1 1234
1994 2 1234
6 rows selected.
SQL> select month,
sum(case year when '1992' then sal end) "1992",
sum(case year when '1993' then sal end) "1993",
sum(case year when '1994' then sal end) "1994"
from sal
group by month;
MO 1992 1993 1994
-- ---------- ---------- ----------
1 1234 1234 1234
2 1234 1234 1234