题解 | #月均完成试卷数不小于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
全部评论

相关推荐

02-18 21:55
门头沟学院 Java
点赞 评论 收藏
分享
01-07 15:50
四川大学 Java
看日出看日落:好好背八股,做算法。我身边跟你bg差不多的基本都大厂暑期
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务