题解 | #牛客每个人最近的登录日期(六)#
牛客每个人最近的登录日期(六)
http://www.nowcoder.com/practice/572a027e52804c058e1f8b0c5e8a65b4
- 分组 累加 应该只能用窗口函数写
- 做个连接
with passing as
(select user_id,date,
sum(number)over(partition by user_id order by date) ps_num
from passing_number
group by user_id,date)
select name,date,ps_num from passing left join user
on passing.user_id == user.id
order by date,name