
select employeenumber
from
where 1=1,
and workingyear >= 5,
and workingyear = yearsincurrentrole,
and yearsincelastpromotion >=1
and attrition = 'No'
select department, jobrole, joblevel, count(*) as HC
from
where 1=1,
and workingyear >= 5,
and workingyear = yearsincurrentrole,
and yearsincelastpromotion >=1
and attrition = 'No'
groupby 1,2,3
orderby 3 desc