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 are three advantages to using sql?
Does sql require a server?
Which one is faster ienumerable or iqueryable?
How would you pass hints to the sql processor?
how to check server status with 'mysqladmin'? : Sql dba
What are the advantages of stored procedure?
How do you modify a table in sql?
What does desc stand for?
What does a pl/sql package consist of?
What are the different parts of a package?
How does left join work in sql?
How do I view an execution plan in sql?
what is the difference between cluster and non cluster index? : Sql dba
Do triggers have restrictions on the usage of large datatypes, such as long and long raw?
Explain raise_application_error.