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

select a.job, a.first_year_mon, a.first_year_cnt, b.second_year_mon,
b.second_year_cnt
from (select job,date_format(date,'%Y-%m') first_year_mon,sum(num) first_year_cnt
from resume_info
where date_format(date,'%Y')='2025'
group by job,date_format(date,'%Y-%m')
) a #a表为2025年的数据
join
(select job,date_format(date,'%Y-%m') second_year_mon,sum(num) second_year_cnt
from resume_info
where date_format(date,'%Y')='2026'
group by job,date_format(date,'%Y-%m')
) b #b表为2026年的数据
on a.job=b.job
where right(a.first_year_mon,2)=right(b.second_year_mon,2)
order by a.first_year_mon desc,a.job desc

,方法比较暴力

全部评论

相关推荐

评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务