用date_format将date的格式变成"%Y-%m"并设置昵称mon,根据job,mon分组汇总并用sum计算每组num总和。然后根据mon和cnt降序排序。
select job, date_format(date, "%Y-%m") as mon, sum(num) as cnt
from resume_info
where year(date) = "2025"
group by job, mon
order by mon desc, cnt desc
用date_format将date的格式变成"%Y-%m"并设置昵称mon,根据job,mon分组汇总并用sum计算每组num总和。然后根据mon和cnt降序排序。
select job, date_format(date, "%Y-%m") as mon, sum(num) as cnt
from resume_info
where year(date) = "2025"
group by job, mon
order by mon desc, cnt desc