haider2016

Sum with SQL

Discussion created by haider2016 on Mar 21, 2017
Latest reply on Mar 21, 2017 by haider2016

Hi there,

I have a table called stages which is a part of a database for a school, this table includes a field called stage_num which contains stage number such as 1,2,..,9. also there is a field called group which contains A,B,C and D. I want to write an SQL to find the summation of students in each group and stage as follows :

 

stage          A                B                  C                    D

  1              30               24                34                   19

  2              21               32                29                   30

  .     . . . . . . .   .

  .......................

  9              34               21                19                   31

 

 

any help please and many thanks in advance

Outcomes