简介

select job, sum(num) as cnt from
resume_info
where resume_info.date < '2026-01-01' and resume_info.date >= '2025-01-01'
group by job
order by cnt desc;

可以使用year函数提取年份 效率会高很多

select job, sum(num) as cnt
  from resume_info
 where year(date) = 2025
 group by job
 order by cnt desc;
posted on 2021-07-01 10:49  HDU李少帅  阅读(48)  评论(0编辑  收藏  举报