I'm joining two tables "classrooms" and "students".
'Classrooms' has 7 school subjects and 'Students' has a list of students with their grades from the classrooms.
I'm trying to do a while loop pulling a list of all the classrooms and pull only 1 student with the highest grade displayed next to the classroom.
I did a JOIN but it's displaying all the students on each class.
Example:
English - student1
English - student2
English - student3
English - student4
English - student5
Science - student1
Science - student2
Science - student3
Science - student4
Science - student5
When I want this displayed:
English - student3 (highest grade)
Science - student1 (highest grade)