select a.id,a.name,a.score
from temp a,(select name,max(score) as max_score from temp group by name) b
where a.name =b.name
and a.score=b.max_score
from temp a,(select name,max(score) as max_score from temp group by name) b
where a.name =b.name
and a.score=b.max_score
博客给出一段SQL代码,通过子查询和连接操作,从temp表中筛选出每个name分组下score最大的记录。代码使用了select、from、where等关键字,实现特定数据的查询。

1671

被折叠的 条评论
为什么被折叠?



