select id , name , grade_num from ( select user_id , sum(real_grade) as grade_num , DENSE_RANK() OVER(ORDER BY SUM(real_grade) DESC) AS rk from ( select user_id , case when type='a...