how to find nth highest salary
Answer Posted / vinay upadhyay
These are tested queries to find Nth highest salary
Select distinct(sal) From employee emp Where n =
( Select Count(Distinct y.sal) From employee y Where y.sal
>=emp.sal)
OR
select distinct(salary) from employee order by salary desc
limit n-1,1
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are .mdf files?
Why we need to use secondry database file? though, we can do same work using primary database file also.
What are the advantages of mirroring?
Does partitioning improve performance sql server?
What are various ways to enhance the ssrs report?
What do you mean by table and field in sql?
What are rest-style architecture's?
How to loop through result set objects using odbc_fetch_row()?
What are distributed partitioned views?
What is provisioning, billing and metering, and connection routing concepts in the service layer?
What are system databases into sql server (2005/2008) : sql server database administration
How to connect ms access to sql servers through odbc?
please differentiate between delete and truncate?
What is transaction server consistency?
How will you add a dimension to cube? : sql server analysis services, ssas