Czy istnieje komenda zbliżona do:Jak znaleźć n-tą najwyższą wartość kolumny?
2nd highest salary from tbl_salary
lub4th highest salary from tbl_salary
?
widziałem:
select salary
from tbl_salary t
where &n = (
select count(salary)
from(
select distinct salary
from tbl_salary
)where t.salary<=salary
);
Jak to działa?
Czy są inne proste sposoby na uzyskanie wyniku?
zobacz także: http://stackoverflow.com/questions/80706 –
Zobacz także: http://stackoverflow.com/questions/2255964/obtain-value-preceding-maximum-value –