The data in mysql db like this and show a result in Datagrid in WPF
 ---------------------------
 class student_ID birthday
 A     1          2000/1/1
 A     5          2001/4/1
 B     2          2000/1/12
 C     3          2001/8/5
 .     .          .
 .     .          .
 Z     1000       2000/12/2
---------------------------
I know use group by and with rollup can select subtotal and total
but I have no idea to do like statistic table
----------------------------------
 month\class    A    B    C ... Z
 JAN            1    2    3 ... 0
 FEB            0    5    6 ... 7
 .              .    .    .
 .              .    .    .
 DEC            4    8    6 ... 1
----------------------------------
One of my way is using case each month,but if the problem becomes statistic date not month, 365 columns is impossible.
What is google way to solve the problem?
 
    