# max(time) timestampdiff(day, event_time, max(time)) < 90 # group by product_id,uid # not in status = 0,2 . id # 窗口函数 count(*) 算 pid.uid 内有多少个 -> 开窗去算 pid 内的满足要求的uid 有多少个 -> avg() over(pid) select distinct product_id, round( avg( if(count(event_time) > 1,1,0) ) over(partition b...