感觉我写的太麻烦了,我去偷个师
select t1.job ,first_year_mon,first_year_cnt,second_year_mon,second_year_cnt
from (select job,date_format(date,'%Y-%m') first_year_mon,sum(num) first_year_cnt
from resume_info where year(date)='2025' group by job,month(date)) t1
join (select job,date_format(date,'%Y-%m') second_year_mon,sum(num) second_year_cnt
from resume_info where year(date)='2026' group by job,month(date)) t2
on t1.job=t2.job and right(first_year_mon,2)=right(second_year_mon,2)
order by first_year_mon desc,job desc;