使用了蠢办法,建立一个新的独立列,用来设置+1/-1 With table1 as ( SELECT user_id,grade_num,type, CASE WHEN type = 'add' then 1 WHEN type = 'reduce' then -1 ...