这是我想要得到的答案。但如果我在MySQL中使用MAX()函数,它只会返回一条记录。如何处理呢?
A_plus ID
2 12345
2 45678
如上所述,我使用的SQL语句如下,但它只返回一条记录。
SELECT MAX(A_plus_Num) AS A_plus, ID FROM
(SELECT COUNT(grade) AS A_plus_Num,ID FROM take WHERE grade = 'A+'GROUP BY ID) AS temp
A_plus ID
2 12345