题解 | #月均完成试卷数不小于3的用户爱作答的类别#

月均完成试卷数不小于3的用户爱作答的类别

https://www.nowcoder.com/practice/b1d13efcfa0c4ecea517afbdb9090845

with data_f_use as (
    select uid, exam_id, start_time, submit_time, tag
    from exam_record
    left join examination_info using (exam_id)
)
 select tag, count(tag) as tag_cnt
 from data_f_use
 where uid in (
        select uid
        from exam_record
        where submit_time is not null
        group by uid
        having (count(exam_id) / count(distinct date_format(start_time, '%Y%m'))) >= 3
    )
  group by tag
  order by tag_cnt desc
月均完成试卷数不小于3的用户必须从submit_time is not null 里筛选
用户爱作答类别必须从所有数据里筛选
全部评论

相关推荐

不愿透露姓名的神秘牛友
06-26 18:18
点赞 评论 收藏
分享
一tiao酸菜鱼:秋招还没正式开始呢,就准备有结果了。。。。?
点赞 评论 收藏
分享
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
06-24 16:03
欲挽天倾:专业毫无意义的 找工作都是看学校title的
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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