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
you want to be sure that queries in a database always execute at the maximum possible speed. To achieve this goal you have created various indexes on tables which other statement will keep the database in good condition? : Sql server administration
What is sql or structured query language?
Why we need to use secondry database file? though, we can do same work using primary database file also.
What is the minimum and maximum number of partitions required for a measure group? : sql server analysis services, ssas
How should i optimize the time for execution of stored procedure having single input and many output from the different tables?
How can a user-defined datatype be created?
What is implicit mode in sql server?
Explain about link server in sql server?
Do you know what are the reporting services components?
What is the Difference Between Primary and Foreign Key?
Mention the differences between sql server and mysql.
How to convert a unicode strings to non-unicode strings?
How to test odbc dsn connection settings?
Difference between aggregate functions of sql?
What are the three different part of rdl file explain them?