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

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

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

select
    b.job,b.first_year_mon,first_year_cnt,
    c.second_year_mon,c.second_year_cnt
from
    (
        select
            a.job,
            substr(a.date, 1, 7) as first_year_mon,
            sum(num) as first_year_cnt
        from
            resume_info a
            where a.date like '2025%'
        group by
            a.job,
            substr(a.date, 1, 7)
    ) b
    left join (
        select
            a.job,
            substr(a.date, 1, 7) as second_year_mon,
            sum(num) as second_year_cnt
        from
            resume_info a
             where a.date like '2026%'
        group by
            a.job,
            substr(a.date, 1, 7)
    )c
    on b.job =c.job 
    and substr(b.first_year_mon,1,4)+1=substr(c.second_year_mon,1,4)
    and substr(b.first_year_mon,6,2)=substr(c.second_year_mon,6,2)
    order by first_year_mon desc, 
    job desc

全部评论

相关推荐

不愿透露姓名的神秘牛友
11-21 19:05
点赞 评论 收藏
分享
球球别再泡了:坏,我单9要了14
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务