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

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

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

第一次写题解,做个纪念吧

select tag, count(*) as tag_cnt 
from 
examination_info
join
(
    select * from 
    exam_record
    where uid in 
    (
        select uid from
        (
            select uid, count(*) as times
            from exam_record
            where submit_time is not NULL and 
                year(start_time)=2021 and month(start_time)=9
            group by uid
            having times>=3
        )a
    )
)b
using (exam_id)
# where submit_time is not NULL and 
#     year(start_time)=2021 and month(start_time)=9
group by exam_id
order by tag_cnt desc
全部评论

相关推荐

01-17 12:35
吉首大学 Java
秋招之BrianGriffin:自己的工作自己做!😡
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务