I have following table:
Type1 Type2
A T1
A T2
A T1
A T1
A T2
A T3
B T3
B T2
B T3
B T3
I want output as:
Type1 T1 T2 T3
A 3 2 1
B 0 1 3
I tried using ROW_NUMBER() OVER (ORDER BY) and CASE Statements but couldn't get desired output. Please Help. Thanks in advance.