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

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

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

select
    a.log_day,
    a.user_id,
    b.hobby
from
    (select
        user_id,
        date_format(log_time,'%Y-%m-%d') as log_day,
        rank() over(partition by date_format(log_time,'%Y-%m-%d') order by log_time) as r_nm
    from
        login_tb
    ) a
left join
    user_action_tb b on a.user_id = b.user_id
where 
    a.r_nm = '1'
order by 
    1

全部评论

相关推荐

点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务