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

牛客每个人最近的登录日期(二)

https://www.nowcoder.com/practice/7cc3c814329546e89e71bb45c805c9ad

select user_name as u_n, client_name as c_n, date from(
select t1.*, t2.name as user_name, t3.name as client_name , rank() over(partition by t1.user_id order by t1.date desc) as ranking from 
login as t1
left join
user as t2
on t1.user_id = t2.id
left join 
client as t3
on t1.client_id = t3.id) as t4
where ranking = 1 order by u_n;

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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