这道题最直接的办法就是直接联立两个表 第一个表查询2025年的数据 第二个表查询2026年的数据 每个表都像上一道题一样,限定job,月份groupby 最后把两个表按照month 和job join在一起 排序即可

select r1.job,r1.first_year_mon,r1.f_cnt,r2.second_year_mon,r2.s_cnt
from 
(select job,DATE_FORMAT(date,"%Y-%m") first_year_mon,sum(num) f_cnt,
MONTH(date) m from resume_info
where YEAR(date)='2025'
group by job,m) r1
join 
(select job,DATE_FORMAT(date,"%Y-%m") second_year_mon,
sum(num) s_cnt,MONTH(date) m from resume_info
where YEAR(date)='2026'
group by job,m) r2
on r1.job = r2.job and r1.m = r2.m
order by r1.first_year_mon desc,r1.job desc