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

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

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

select
    d.tag,
    count(start_time) tag_cnt
from
    exam_record c
    left join examination_info d on c.exam_id = d.exam_id
where
    uid in (
        select
            uid
        from
            (
                select
                    uid,
                    count(submit_time) complete
                from
                    exam_record a
                group by
                    uid,
                    date_format (start_time, '%y%m')
                having
                    complete >= 3
            ) b
    )
group by
    d.tag
order by
    tag_cnt desc

全部评论

相关推荐

ResourceUt...:楼主有自己的垃圾箱,公司也有自己的人才库
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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