Mysql分组后取最大值的那一行
mysql是指取到的那一行,并不是包含最大分数的那一行SELECT a.* ,c.* FROM tbstudent a INNER JOIN(SELECT SUBJECT,MAX(score) score FROM tbstudent GROUP BY SUBJECT)b ON a.SUBJECT=b.SUBJECT AND a.score=b.score INNER JOIN tbclass c ON a.classid=c.classid WHERE c.classname=‘二四’ O