这题并不难
由上题的表做出2026年的表,
select job,date_format(date,'%Y-%m') as smon,sum(num) as scnt,date FROM resume_info WHERE date LIKE "2026%" GROUP BY job,smon
以job和month相等链接两个表
SELECT a.job,fmon,fcnt,smon,scnt FROM (select job,date_format(date,'%Y-%m') as fmon,sum(num) as fcnt,date FROM resume_info WHERE date LIKE "2025%" GROUP BY job,fmon) a JOIN (select job,date_format(date,'%Y-%m') as smon,sum(num) as scnt,date FROM resume_info WHERE date LIKE "2026%" GROUP BY job,smon) b on month(a.date)=MONth(b.date) AND a.job=b.job ORDER BY fmon desc,job desc