select id,max(co) from (select id,date_sub(time,INTERVAL cum day) as base_time ,count(*) as co #计数 from (select *,row_number() over(PARTITION by id order by time) as cum #按照用户id进行分组,按照登录日期dt进行排序 from (select DISTINCT id,date(date) as time from tb order by id #用户登录日期dt去重 )a )b grou...