-- 获得每月岗位的投递总数 with each_month_job as ( select job,SUBSTRING(y_month,1,4) as year,SUBSTRING(y_month,6,2) as month,y_month, sum_num from( select job,SUBSTRING(date,1,7) as y_month,sum(num) as sum_num from resume_info group by job,y_month )a ) -- 自己链接自己 select a.job,a.y_month,a.sum_num,b....