开发者

How to get unique result in mysql

开发者 https://www.devze.com 2023-01-15 20:12 出处:网络
I have table: namemarks aaa100 aaa56 aaa120 bbb56 bbb60 开发者_如何学C The result should be: aaa120 bbb60

I have table:

name        marks

aaa         100
aaa         56
aaa         120
bbb          56
bbb          60
开发者_如何学C
The result should be:
aaa         120
bbb          60

ie unique name with maximum marks. Is there any query in mysql?


 SELECT name, MAX(marks) marks
 from table
 group by name
0

精彩评论

暂无评论...
验证码 换一张
取 消