with t as ( SELECT uid,date(start_time) as start_day,exam_id, row_number() over(partition by uid order by start_time) as ranking from exam_record ) SELECT t.uid,max(datediff(t1.start_day,t.start_day)+1) as days_window, count( t.exam_id), round((count( t.exam_id)/(datediff(max(t.start_day),...