I have Dept table like this:
select * from Dept
ID Class
--------------
01 A
01 A
01 B
02 A
02 B
02 B
02 B
03 C
I want to create a view so the result goes like this :
ID Count_A Count_B Count_C
---------------------------------------
01 2 1 0
02 1 3 0
03 0 0 1
I don't know how to type the SQL commands for it, plz help me!
select * from Dept
ID Class
--------------
01 A
01 A
01 B
02 A
02 B
02 B
02 B
03 C
I want to create a view so the result goes like this :
ID Count_A Count_B Count_C
---------------------------------------
01 2 1 0
02 1 3 0
03 0 0 1
I don't know how to type the SQL commands for it, plz help me!