sql script

select name, max(grade_sum)
from (select user_id, sum(grade_num) as grade_sum
      from grade_info
      group by user_id
      order by grade_sum desc
      limit 1) tmp,
      `user` u
where tmp.user_id=u.id