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

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

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

本题就是2个结果进行组合
1个是2025年的结果 然后 join 2026年的结果

select job,date_format(date,'%Y-%m') as first_year_mon,sum(num) as first_year_cnt,date_format(date,'%m') as f1 from resume_info
where year(date)=2025
group by first_year_mon ,job

这里就能把2025年的结果挑出来

select job,date_format(date,'%Y-%m') as decond_yaer_mon,sum(num) as second_year_cnt,date_format(date,'%m') as f2 from resume_info
where year(date)=2026
group by decond_yaer_mon ,job

把2026年的结果调出来
当时合并的时候用 job相等合并,当时带来的问题就是 不同的月也合并在了一起,所以把月单独抽出来,作为一个限制条件

select a.job,a.first_year_mon,a.first_year_cnt,b.decond_yaer_mon,b.second_year_cnt from 
(select job,date_format(date,'%Y-%m') as first_year_mon,sum(num) as first_year_cnt,date_format(date,'%m') as f1 from resume_info
where year(date)=2025
group by first_year_mon ,job ) as a 
left join 
(select job,date_format(date,'%Y-%m') as decond_yaer_mon,sum(num) as second_year_cnt,date_format(date,'%m') as f2 from resume_info
where year(date)=2026
group by decond_yaer_mon ,job ) as b
on a.job=b.job and a.f1=b.f2
order by a.first_year_mon desc,a.job desc
全部评论

相关推荐

rbjjj:太杂了吧,同学,项目似乎都没深度,都是api调度耶,分层架构思想没有体现出来了,前端没有前端优化前端工程化体现,后端微服务以及分层架构没体现以及数据安全也没体现,核心再改改,注重于计算机网络,工程化,底层原理吧
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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