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
Why use truncate instead of delete?
what are the join types in tsql? : Transact sql
How do you respond to dementia behavior?
What is latest version of sql?
When to use inner join and left join?
Explain character-manipulation functions?
What is clustered index in sql?
What are the different ddl commands in sql?
Is sqlexception checked or unchecked?
What is sql indexing?
how to check server status with 'mysqladmin'? : Sql dba
How do sql triggers work?
How many scalar data types are supported in pl/sql?
What are the differences between in and exists clause?
what is 'mysqlcheck'? : Sql dba