题解 | 每天登陆最早的用户的内容喜好

每天登陆最早的用户的内容喜好

https://www.nowcoder.com/practice/24bb13a28267486ba86c1d21459fa90a

select
t.log_day,
t.user_id,
t.hobby
from
(select
date(l.log_time) as log_day,
l.user_id,
u.hobby,
rank() over(partition by date(l.log_time) order by l.log_time asc) as timerank
from login_tb l left join user_action_tb u
on l.user_id=u.user_id) t
where t.timerank=1
order by t.log_day asc;

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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