WITH ss AS (SELECT SUM(IF(type = 'add', grade_num, -grade_num)) OVER ( PARTITION BY user_id) a, user_id FROM grade_info) , sss AS (SELECT MAX(a) ba FROM ss) SELEC...