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

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

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

select
    ei.tag as tag,
    count(*) as tag_cnt
from
    exam_record er
    left join examination_info ei on er.exam_id = ei.exam_id
    inner join 
     (
        SELECT
            distinct uid
        FROM
            exam_record
        where
            submit_time is not null
        GROUP BY
            uid,
            month(submit_time)
        HAVING
            count(submit_time) > 2
    ) u on er.uid = u.uid
group by
    tag
order by
    tag_cnt desc

全部评论

相关推荐

我冲冲冲冲冲:泪目了,好想选自己想选的答案啊
点赞 评论 收藏
分享
10-30 21:47
已编辑
广东财经大学 web前端
小红书 实习 9-10k
哇咔咔嘞:先签小厂,然后去实习,春招找到好的再违约
点赞 评论 收藏
分享
2 收藏 评论
分享
牛客网
牛客企业服务