知识点:

  1. order by 后面可以跟聚合后的字段 cnt
  2. 日期为:在2025年内,使用 sbustr() 函数提取出日期字段的年份
    select 
     job, 
     sum(num) as cnt
    from resume_info
    where substr(date, 1, 4) = '2025'
    group by job
    order by cnt desc
    ;

DATE_FORMAT(date,format)
DATE_FORMAT() 函数用于以不同的格式显示日期/时间数据。
date 参数是合法的日期。format 规定日期/时间的输出格式。
可以使用的格式有:
常用格式 对应描述
%Y --年,4 位
%m --月,数值(00-12)
%M --月名
%k --小时(0-23)

常用字符串函数
知识点:对字符串的操作

常用函数 对应描述
RIGHT(s,n) 返回字符串 s 的后 n 个字符
LEFT(s,n) 返回字符串 s 的前 n 个字符
MID(s,n,len) 从字符串 s 的 n 位置截取长度为 len 的子字符串,同 SUBSTRING(s,n,len)
LCASE(s) 将字符串 s 的所有字母变成小写字母