如何在mysql中获得唯一的结果
我有一张桌子:如何在mysql中获得唯一的结果,sql,mysql,Sql,Mysql,我有一张桌子: name marks aaa 100 aaa 56 aaa 120 bbb 56 bbb 60 The result should be: aaa 120 bbb 60 ie具有最大标记的唯一名称。mysql中有任何查询吗 SELECT name, MAX(marks) marks from table group by name
name marks
aaa 100
aaa 56
aaa 120
bbb 56
bbb 60
The result should be:
aaa 120
bbb 60
ie具有最大标记的唯一名称。mysql中有任何查询吗
SELECT name, MAX(marks) marks
from table
group by name