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

select
    date_format (l.log_time, '%Y-%m-%d') as log_day,
    l.user_id as user_id,
    hobby
from
    login_tb l,
    user_action_tb u,
    (
        select
            date_format (log_time, '%Y-%m-%d') as log_day,
            min(log_time) as log_time
        from
            login_tb
        group by
            log_day
    ) a
where
    l.user_id = u.user_id
    and l.log_time = a.log_time
    and date_format (l.log_time, '%Y-%m-%d') = a.log_day

全部评论

相关推荐

哈哈哈哈哈哈哈哈哈哈这个世界太美好了
凉风落木楚山秋:毕业出路老师不管,你盖个章他好交差就完事了,等你盖完毕业了就不关他事情了
点赞 评论 收藏
分享
05-27 14:57
西北大学 golang
强大的社畜在走神:27届真不用急,可以搞点项目、竞赛再沉淀沉淀,我大二的时候还在天天打游戏呢
投递华为等公司10个岗位
点赞 评论 收藏
分享
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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