题解 | 牛客每个人最近的登录日期(五)

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

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务