思路

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

http://www.nowcoder.com/questionTerminal/83f84aa5c32b4cf5a75558d02dd7743c

思路分享:
首先查找2026年的简历投递情况->查找2025年的简历投递情况->上述两查询结果以job和月份进行内联结->从内联结表中获取所有信息
step1-2: 查找2026/2025年的简历投递情况:

select job,date,date_format(date,'%Y-%m') as second_year_mon,sum(num) as second_year_cnt
from resume_info 
where date like '2026%'
group by job,second_year_mon 

step2:上述两查询结果以job和月份进行内联结

(
    select job,date,date_format(date,'%Y-%m') as second_year_mon,sum(num) as second_year_cnt
    from resume_info 
    where date like '2026%'
    group by job,second_year_mon 
)as tmp2
inner join 
(
    select job,date,date_format(date,'%Y-%m') as second_year_mon,sum(num) as second_year_cnt
    from resume_info 
    where date like '2025%'
    group by job,second_year_mon 
) as tmp
on  tmp.job = tmp2.job and date_format(tmp.date,'%m') =  date_format(tmp2.date,'%m') 

step3:查询最终结果

select tmp.job,first_year_mon,first_year_cnt,second_year_mon ,second_year_cnt 
(
    select job,date,date_format(date,'%Y-%m') as second_year_mon,sum(num) as second_year_cnt
    from resume_info 
    where date like '2026%'
    group by job,second_year_mon 
)as tmp2
inner join 
(
    select job,date,date_format(date,'%Y-%m') as second_year_mon,sum(num) as second_year_cnt
    from resume_info 
    where date like '2025%'
    group by job,second_year_mon 
) as tmp
on  tmp.job = tmp2.job and date_format(tmp.date,'%m') =  date_format(tmp2.date,'%m') 
order by tmp.first_year_mon DESC,tmp.job DESC
全部评论
运行不出答案
点赞 回复 分享
发布于 2021-09-23 11:31
这样不对把
点赞 回复 分享
发布于 2021-08-22 14:56

相关推荐

不愿透露姓名的神秘牛友
今天 17:10
点赞 评论 收藏
分享
06-13 10:15
门头沟学院 Java
想去夏威夷的大西瓜在...:我也是27届,但是我现在研一下了啥项目都没有呀咋办,哎,简历不知道咋写
点赞 评论 收藏
分享
能干的三文鱼刷了10...:公司可能有弄嵌入式需要会画pcb的需求,而且pcb能快速直观看出一个人某方面的实力。看看是否有面试资格。问你问题也能ai出来,pcb这东西能作假概率不高
点赞 评论 收藏
分享
CARLJOSEPH...:宝宝你戾气太大了
点赞 评论 收藏
分享
评论
2
收藏
分享

创作者周榜

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