select sum(case when record like '%博士%' then 1 else 0 end) 博士, sum(case when record like '%硕士%' then 1 else 0 end) 硕士, sum(case when record like '%本科%' then 1 else 0 end) 本科, sum(case when record not like '%博士%' and record not like '%硕士%' and record not like '%本科%' then 1 else 0 end) 专科及以下 from dw.dw_hr_new_emp where yearmonth<='${yearmonth}' and left(yearmonth,4)=to_char(now(),'yyyy') group by case when record like '%博士%' then 1 else 0 end, case when record like '%硕士%' then 1 else 0 end, case when record like '%本科%' then 1 else 0 end, case when record not like '%博士%' and record not like '%硕士%' and record not like '%本科%' then 1 else 0 end
|