题解 | #实习广场投递简历分析(三)#
实习广场投递简历分析(三)
https://www.nowcoder.com/practice/83f84aa5c32b4cf5a75558d02dd7743c
select t1.job, first_year_mon, first_year_cnt, second_year_mon, second_year_cnt from ( SELECT job, DATE_FORMAT(date, '%Y-%m') AS first_year_mon, SUM(num) AS first_year_cnt FROM resume_info WHERE year(date) = 2025 GROUP BY job, first_year_mon ORDER BY first_year_mon desc, first_year_cnt desc ) t1 left join ( select job, DATE_FORMAT(date, '%Y-%m') AS second_year_mon, SUM(num) AS second_year_cnt from resume_info where year(date) = 2026 GROUP BY job, second_year_mon ORDER BY second_year_mon desc, second_year_cnt desc ) t2 on t1.job = t2.job and substring_index(t1.first_year_mon, '-', -1) = substring_index(t2.second_year_mon, '-', -1) order by first_year_mon desc, t1.job desc