#明确问题:登录的当前日期=该用户所有登录日期的最小值

select date
        ,count(distinct case when (user_id,date) in
    (select user_id,min(date)from login group by user_id)
    then user_id else null end)
from login
group by date
order by date;