题解 | #实习广场投递简历分析(三)#

实习广场投递简历分析(三)

https://www.nowcoder.com/practice/83f84aa5c32b4cf5a75558d02dd7743c

select
    a.job,
    a.mon fmon,
    a.cnt fcnt,
    b.mon smon,
    b.cnt scnt
from
    (
        select
            job,
            date_format (date, '%Y-%m') mon,
            sum(num) cnt
        from
            resume_info
        where
            substring(date, 1, 4) = '2025'
        group by
            job,
            mon
    ) a,
    (
        select
            job,
            date_format (date, '%Y-%m') mon,
            sum(num) cnt
        from
            resume_info
        where
            substring(date, 1, 4) = '2026'
        group by
            job,
            mon
    ) b
where
    a.job = b.job and right(a.mon,2)=right(b.mon,2)
    
order by
    fmon desc,
    job desc

全部评论

相关推荐

03-01 19:30
已编辑
南京大学 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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