i have the table resources which contains all data, i want to get the result as given in last table.. Please help me
Dept Grade
A E3
B M2
D E3
C M1
A E3
D E4
A E3
i used the below code but i am not able to get the actual solution
SELECT DISTINCT Department,COUNT(DISTINCT GRADE) as Grades FROM reslookup GROUP BY Department;
Executed Result for the about query,
Dept Grade
A 3
B 1
C 1
D 2
But, i want to get the result like given below
Dept E3 E4 M1 M2
A 5 0 2 1
B 4 2 3 0
C 8 9 2 1
D 5 0 2 6