#首先这个题就是** #按条件计算公式 select tmp2.uid ,max(tmp2.diff_d) as days_window ,round(max(tmp2.cnt)/max(tmp2.max_d)*max(tmp2.diff_d),2) as avg_exam_cnt from(#筛选满足条件的用户where select tmp1.uid ,tmp1.diff ,timestampdiff(day,substr(tmp1.first_d,1,10),substr(tmp1.last_d,1,1...