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

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

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


# 加max聚合函数的原因是因为再对2025和2026俩个表进行连接的时候,需要根据job和月份进行匹配,而我尝试用 
# month(a.mon)=month(b.mon)时,无法连接上数据,不到何原因,所以只能在a表和b表中添加一个max聚合函数来确定每
# 个月的最大日期,最后在连接时,可以用month()来匹配2025和2026对应的月份

select
a.job
,a.mon as first_year_mon
,a.cnt as first_year_cnt
,b.mon as second_year_mon
,b.cnt as second_year_cnt
from(
select
a.job
,date_format(a.date,'%Y-%m') as mon
,max(a.date) as "date"
,sum(a.num) as cnt
from resume_info a
where year(a.date)=2025
group by a.job,date_format(a.date,'%Y-%m')
) a
left join(
select
a.job
,date_format(a.date,'%Y-%m') as mon
,max(a.date) as "date"
,sum(a.num) as cnt
from resume_info a
where year(a.date)=2026
group by a.job,date_format(a.date,'%Y-%m')
) b
on a.job=b.job and month(a.date)=month(b.date)
order by first_year_mon desc,a.job desc
;


全部评论

相关推荐

VirtualBool:都去逗他了?
点赞 评论 收藏
分享
程序员牛肉:主要是因为小厂的资金本来就很吃紧,所以更喜欢有实习经历的同学。来了就能上手。 而大厂因为钱多,实习生一天三四百的就不算事。所以愿意培养你,在面试的时候也就不在乎你有没有实习(除非是同级别大厂的实习。) 按照你的简历来看,同质化太严重了。项目也很烂大街。 要么换项目,要么考研。 你现在选择工作的话,前景不是很好了。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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