题解 | #牛客每个人最近的登录日期(二)# 好像没看到用partition by的
牛客每个人最近的登录日期(二)
http://www.nowcoder.com/practice/7cc3c814329546e89e71bb45c805c9ad
select user.name, client.name, d date
from user,
client,
(select *, max(date) over(partition by user_id) d from login) t
where user.id = t.user_id
and client.id = t.client_id
and t.date = t.d
order by user.name
;

查看13道真题和解析