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

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

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

#有毒,是月均,意思是每个月都要>=3?????
#漏了group by  month(start_time) 一直报错

select distinct
    tag,
    count(tag) over (
        PARTITION BY
            tag
    ) tag_cnt
from
    (
        select
            *
        from
            exam_record
        where
             uid in (
                select
                    uid
                from
                    exam_record
                where submit_time is not null
                group by
                month(start_time),
                    uid
                having
                    count(uid) >= 3
            ) 
    ) s
    inner join examination_info e on e.exam_id = s.exam_id
order by tag_cnt desc


全部评论

相关推荐

点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
07-15 17:24
点赞 评论 收藏
分享
06-17 21:57
门头沟学院 Java
白友:噗嗤,我发现有些人事就爱发这些,明明已读不回就行了,就是要恶心人
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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