I have below problem -
Table with millions of records in below format -
Scale ID
01 2001
01 2001
03 2002
05 2003
78 2011
76 2010
so on ..
Scale ranges from 01-100 and ID ranges from 2001 - 2011.
I want a new table out of this which counts each scale for each year.
Output should be something like this.
Scale 2001 2002 2003 2004 ---- 2011
1 2 0 0 0 ---- 0
2 0 0 0 0 ------ 0
3 0 1 0 0 ------- 0
4 0 0 0 0 ------ 0
5 0 0 1 0 ------ 0
-
-
-
-
100
Trying to do it in SQL. any help will be great.
Thanks