sql
题目描述
现在有简历信息表(resume_info),写出SQL语句查询在2025年内投递简历的岗位和数量,并且按数量降序排序
思路
时间限制:2025年,可用函数提取年份year(date)='2025',date_format(date,'%Y')='2025'
岗位投递数量和:按Job group by,进行求和
代码
sql1
select
job,
sum(num) AS cnt
from
resume_info
where
year(date) = '2025'
group by
job
order by
cnt desc;
sql2
select
job,
sum(num) AS cnt
from
resume_info
where
date_format(date,'%Y') = '2025'
group by
job
order by
cnt desc;
标签:cnt,resume,2025,job,sql,date
From: https://www.cnblogs.com/loongnuts/p/17101759.html