select distinct c.emp_no ,count(c.emp_no) from (select emp_no ,year(from_date) ,salary 现有工资 ,lag(salary,1)over(partition by emp_no order by from_date) 上年工资 ,(salary-lag(salary,1)over(partition by emp_no order by from_date)) 涨幅 from salaries) as c where 涨幅 >0 and 涨幅 is not null group by c.emp_no