how to find nth highest salary

Answer Posted / anonymous

select min(salary) from(
select salary from test
order by salary desc
)
where rownum<4



For ORACLE 8i,9i,10g


select distinct salary from
(select salary,
dense_rank() OVER (PARTITION BY empname ORDER BY salary
desc) rank
from test) where rank=7
;

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to get the definition of a trigger back?

548


i have made a project i vb.net n created a .exe of it after installing it in to any pc, the database (sql express) is not geting accesed i.e the aplication cuts the link of the database, so plz help in this matter.

1374


tell me what are the steps you will take to improve performance of a poor performing query? : Sql server database administration

567


If we delete pack Spec what will be the status of pack Body ?

968


How can I track the changes or identify the latest insert-update-delete from a table?

537






How do I manually uninstall an instance of sql server 2016?

547


What is named calculation? : sql server analysis services, ssas

531


What are the different index configurations a table can have?

517


Is it possible to have clustered index on separate drive from original table location?

513


What is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting is possible?

488


How to apply cascading referential integrity in place of triggers?

570


How many types of functions are there in sql server?

459


What are the functions in sql server?

545


How you can get the list of largest tables in a database?

529


Tell me what is use of except clause? How it differs from not in clause?

513