How to get employee name from employee table which is the
fiveth highest salary of the table

Answers were Sorted based on User's Feedback



How to get employee name from employee table which is the fiveth highest salary of the table..

Answer / 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

How to get employee name from employee table which is the fiveth highest salary of the table..

Answer / praveen

SELECT TOP 1 salary
FROM
(
select TOP 5 salary
FROM
employee
ORDER BY
salary DESC
) A
ORDER BY
salary

Is This Answer Correct ?    1 Yes 0 No

How to get employee name from employee table which is the fiveth highest salary of the table..

Answer / raghuvir

select * from employee where salary = (
select min(salary) from (
select distinct(salary) from employee
order by salary desc)
where rownum <=5)

Is This Answer Correct ?    1 Yes 0 No

How to get employee name from employee table which is the fiveth highest salary of the table..

Answer / ramu

select employee_name,salary from employee order by salary desc limit 1 offset 4;

Is This Answer Correct ?    1 Yes 0 No

How to get employee name from employee table which is the fiveth highest salary of the table..

Answer / vijay

select min(salary) from (select rownum r,e.* from employees e order by salary desc) where rownum<=5;

Is This Answer Correct ?    0 Yes 0 No

How to get employee name from employee table which is the fiveth highest salary of the table..

Answer / mrunali

select name from (select e.*, dense_rank() over (order by salary desc nulls last)as rn from emp e) where rn=5

Is This Answer Correct ?    0 Yes 0 No

How to get employee name from employee table which is the fiveth highest salary of the table..

Answer / raju t.t

select firt_name, salary from employees a where 5=(select
count(distinct salary from employees b where a.salary
<=b.salary);

Is This Answer Correct ?    6 Yes 7 No

How to get employee name from employee table which is the fiveth highest salary of the table..

Answer / anil alpati

SELECT employee_name FROM employee order by salary desc limit 1 offset 5 ;

Is This Answer Correct ?    0 Yes 1 No

How to get employee name from employee table which is the fiveth highest salary of the table..

Answer / anil alpati

Select empsal From emp order by empsal desc offset 5 limit 1;

Is This Answer Correct ?    0 Yes 3 No

How to get employee name from employee table which is the fiveth highest salary of the table..

Answer / shivashanker

Anybody knows the answer

Is This Answer Correct ?    1 Yes 6 No

Post New Answer

More SQL PLSQL Interview Questions

What is bulk collections?

2 Answers  


What is difference between cursor and trigger?

0 Answers  


What is a database event trigger?

0 Answers  


how can we know the count/number of elements of an array? : Sql dba

0 Answers  


What does sql stand for?

0 Answers  






how to calcuate the second highest salary of he employee

13 Answers   Synechron,


What is synonyms?

0 Answers  


I have a tablle like this. cust acc --------------- a 1 b 2|3 c 4|5|6 I Want below o/p: cust acc ----------- a 1 b 2 b 3 c 4 c 5 c 6 Please any one can you have any ideas share me. I have urgent requirement.

4 Answers   Cap Gemini, MTS,


What is magic table?

6 Answers  


what are the differences between procedure-oriented languages and object-oriented languages? : Sql dba

0 Answers  


how is myisam table stored? : Sql dba

0 Answers  


Which is better join or inner query?

0 Answers  


Categories