I am using oracle 11gR2 running on windows server 2008 R2
I have a table like this
year code value
---- ---- -----
1991 1 v1
1991 2 v2
1991 3 v3
1992 1 v4
1992 2 v5
1992 3 v6
...
2050
The code column can be from 1 through 10.
I would like to see the final output as (columns having value 1 through 10)
year 1 2 3 4 .... 10
---- -- -- -- -- --
1991 v1 v2 v3 null.......null
1992 v4 v5 v6. ...etc
How can i do the pivoting to get the result in the above format? Thanks in advance.