How to get employee name from employee table which is the
fiveth highest salary of the table
Answer Posted / a g srikanth
Dear Shiv Shankar
There is a small mistake in your query
Select Salary From Employee a Where 5=(
Select Count(Distinct Salary) From Employee b
Where a.Salary <= b.Salary )
the correct one should be
Select Salary From Employee a Where 5=(
Select Count(Distinct Salary) From Employee b
Where a.Salary >= b.Salary )
please check it...
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the use of function in sql?
How can we optimize a sql query?
what is offset-fetch filter in tsql? : Transact sql
What are sql constraints?
Can we join tables without foreign key?
Why is sharding used?
What is database white box testing and black box testing?
How do I quit sql?
What are all the different types of indexes?
What are the different ways to optimize a sql query?
what is bdb (berkeleydb)? : Sql dba
How do you clear the screen in sql?
Hi am new to PLSQL & facing problems in writing code like in SP, Functions, so any one having some SP coding with in depth explanation please share with me my Email ID suvarnaatsuvarna@rediffmail.com Or taking tanning on this please do contact me
How many times can we commit in a loop?
What is rollback?