Find Number of Students and total fees in each class

  • Dear Sir,

    I have a student table which consists of four fields, (id, FullName,Class, Fees)

    I want to know how many students I have in each clas and the subtotal Fee in each class.

    Please help.

    Cheers

  • Hi, the below should get you want you need based on your details.

    If not, please follow the second link in my signature on how to post code and data so that we can help you get the solution your after.

    SELECT

    Class,

    COUNT(ID) AS NumStudents,

    SUM(Fees)

    FROM

    SomeTable

    GROUP BY

    Class

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply