聚合函数sum加group by得出以job分组每组num的总和,然后限制date在2025年。我这里用的办法比较原始,year(date)可以直接提取日期的年部分。
select job, sum(num) as cnt from resume_info
where date >= "2025-01-01" and date <= "2025-12-31"
group by job
order by cnt desc
聚合函数sum加group by得出以job分组每组num的总和,然后限制date在2025年。我这里用的办法比较原始,year(date)可以直接提取日期的年部分。
select job, sum(num) as cnt from resume_info
where date >= "2025-01-01" and date <= "2025-12-31"
group by job
order by cnt desc