题解 | 牛客每个人最近的登录日期(五)
select date ,p_login
from (
select distinct date ,0 as p_login
from login
where date not in ( select min(date) over(partition by user_id) from login)
union
select m_date as date, count(distinct user_id)as p_login
from(
select user_id,min(date) as m_date
from login
group by user_id
)t
group by m_date
) t
order by date
