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

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

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

with
    tmp as (
        select distinct
            job,
            date_format (date, '%Y-%m') as d,
            sum(num) over (
                partition by
                    date_format (date, '%Y-%m'),
                    job
            ) as cnt,
            dense_rank() over (
                partition by
                    job
                order by
                    date_format (date, '%m') DESC
            ) as tk
        from
            resume_info
        where
            date < '2027-01-01'
    )
select distinct
    t1.job,
    t1.d as first_year_mon,
    t1.cnt as first_year_cnt,
    t2.d as second_year_mon,
    t2.cnt as second_year_cnt
from
    tmp as t1
    join tmp as t2 on t1.job = t2.job
    and t1.tk = t2.tk
    and timediff (t1.d, t2.d) = -1
order by
    first_year_mon DESC,
    job DESC

全部评论

相关推荐

在笔试的柠檬精很想去...:兄弟们,你们这个大厂,中厂,小厂怎么定义的 初来驾到,别笑话我,只要能学到本事,不管大厂小厂都可以,但是别进到黑厂就行
找实习记录
点赞 评论 收藏
分享
01-19 12:48
门头沟学院 C++
只想搞钱的鸽子很喜欢...:混账是很多的,还有那些在自己风华正茂的年纪说风凉话讥讽那些下岗前员工的。这些人都是现在职场环境这么烂的帮凶
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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