I have this statement that displays the following fields.
select distinct sch.school_number, sch.name, cs.course_number, cs.course_name, [PossibleCredits]
from courses cs
inner join schools sch on cs.schoolid = sch.school_number
inner join sections se on cs.course_number = se.course_number
order by sch.school_number, cs.course_number
Now I'd like to get the sum of the num_of_students in each course section. Each record in the sections table has a field called num_of_students and this should be added (by course_number) and displayed as PossibleCredits.
How can I accomplish this? Thanks.