使用窗口函数denese_rank 能快捷做出来
select
a.emp_no,
a.salary
from
(select
emp_no,
salary,
dense_rank() over(order by salary desc) rank1
FROM
salaries)a
where rank1=2
order by a.emp_no
使用窗口函数denese_rank 能快捷做出来
select
a.emp_no,
a.salary
from
(select
emp_no,
salary,
dense_rank() over(order by salary desc) rank1
FROM
salaries)a
where rank1=2
order by a.emp_no