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