select user_id ,max(连续登录天数) as max_consec_days from ( select distinct user_id, max(日期排序)-min(日期排序)+1 as 连续登录天数 from ( select distinct user_id, fdate, row_number() over(partition by user_id order by fdate) as 日期排序, date_sub(fdate,interval row_number()...