查询每班的最高分

    select distinct student.id,student.username,student.score,student.classID,class.className   
    from student

    inner join class  
    on class.id = student.classID

   inner join (
   select max(score) as score ,classID from student group by classID
  )as maxScore on maxScore.score = student.score