Find out the 3rd highest salary?

Answers were Sorted based on User's Feedback



Find out the 3rd highest salary?..

Answer / tathagoto

select sal from (select sal from salary order by sal desc)
where rownum <4;

Is This Answer Correct ?    1 Yes 4 No

Find out the 3rd highest salary?..

Answer / santosh

select level,max(sal) from emp where level=3 connect by
prior sal>sal
group by level;

Is This Answer Correct ?    0 Yes 3 No

Find out the 3rd highest salary?..

Answer / sachin

select * from ( select * from (select * from emp order by
sal desc)
where rownum<=3
order by rownum desc)
where rownum=1

Is This Answer Correct ?    1 Yes 4 No

Find out the 3rd highest salary?..

Answer / xyz

select a.sal from (select distinct(sal) from emp order by
sal desc)a where rownum=3

Is This Answer Correct ?    2 Yes 7 No

Find out the 3rd highest salary?..

Answer / srijith pillai

This will give you third highest salary

select ename, sal from
(Select name, sal, rownum()Over(Order by sal Desc) rt
FROM emp)
where rt = 3;

Is This Answer Correct ?    13 Yes 19 No

Find out the 3rd highest salary?..

Answer / manoj

SELECT min(salary)
FROM (
SELECT e.salary , ROWNUM
FROM emp e
ORDER BY salary DESC
AND ROWCOUNT <=3
)
ROWNUM =3;

Is This Answer Correct ?    3 Yes 9 No

Find out the 3rd highest salary?..

Answer / umesh naik

select max(amount) from (
select distinct amount from temp123
where rownum <= 3
)

Is This Answer Correct ?    1 Yes 8 No

Find out the 3rd highest salary?..

Answer / s.dineshkumar

Select Top 1 Salary from (Select top 3 Salary from Employee
order by salary desc ) a

Is This Answer Correct ?    0 Yes 7 No

Find out the 3rd highest salary?..

Answer / satya

Hi,

Select sal from emp e where 3>=(select count (Sal)
from emp where sal>e.sal) order by sal desc;

Regards,
Satya.k

Is This Answer Correct ?    23 Yes 35 No

Find out the 3rd highest salary?..

Answer / shaiju nair

select min(sal) from (Select sal
FROM emp where rownum<=3
Order by sal desc)

Is This Answer Correct ?    13 Yes 25 No

Post New Answer

More SQL PLSQL Interview Questions

Is not null in sql?

0 Answers  


What is the difference between local and global temporary table?

0 Answers  


What is a schema? How is it useful in sql servers?

0 Answers  


What do we need to check in database testing?

0 Answers  


How to use boolean type in select statement?

0 Answers  






How to generate a salary slip like jan 1000 1000 feb 1000 2000 ... dec 1000 12000

0 Answers   BT,


What is rename in sql?

0 Answers  


What is crud diagram?

0 Answers  


What is the least restrictive isolation level? : Transact sql

0 Answers  


How can analyze query after generating explain plan ?

2 Answers   Thermotech,


What is the difference between row level and statement level trigger?

0 Answers  


Is it possible to use LONG columns in WHERE clause or ORDER BY?

3 Answers  


Categories