So, I have this kind of table:
I want to Group the id_class, and count the id_student like this:
I used this query:
SELECT id, id_class, COUNT(id_student) FROM tbl_school_years GROUP BY id_class
but I got this error:
Failed to run sql query: column "tbl_school_years.id" must appear in the GROUP BY clause or be used in an aggregate function
Any solution? Any help will be appreciated