是否有类似于的命令:
2nd highest salary from tbl_salary 要么
4th highest salary from tbl_salary ?
我见过:
select salary
from tbl_salary t
where &n = (
select count(salary)
from(
select distinct salary
from tbl_salary
)where t.salary<=salary
);
Run Code Online (Sandbox Code Playgroud)
它是如何工作的?
有没有其他简单的方法来获得结果?