select emp_no, max(salary) -min(salary) as growth from (select emp_no,salary,from_date, min(from_date) over(partition by emp_no) as min_fromdate, max(from_date) over(partition by emp_no) as max_fromdate from salaries where emp_no in (select distinct emp_no from salaries where to_date='9999-01-01'))t where t.from_date=t.min_fromdate or t.from_date=t.max_fromdate group by emp_no order by growth 我给搞复杂了,没想到first_value这个
点赞

相关推荐

牛客网
牛客网在线编程
牛客网题解
牛客企业服务