Find out the 3rd highest salary?

Answers were Sorted based on User's Feedback



Find out the 3rd highest salary?..

Answer / shruti

select empno,sal from
(select empno,sal from emp order by sal desc)
where rownum<4

Is This Answer Correct ?    2 Yes 0 No

Find out the 3rd highest salary?..

Answer / tathagoto

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

Is This Answer Correct ?    4 Yes 3 No

Find out the 3rd highest salary?..

Answer / sathiskumar

select min(sal) from (select top 3 salary from employee);

Is This Answer Correct ?    1 Yes 0 No

Find out the 3rd highest salary?..

Answer / av.anil

SELECT * FROM
(SELECT Ename,Sal,
DENSE_RANK()
OVER(ORDER BY Sal DESC) "D_RK"
FROM Emp)
WHERE D_RK = 3;

This query gives exact highest salary.

Is This Answer Correct ?    1 Yes 0 No

Find out the 3rd highest salary?..

Answer / jagdish

select max(sal) from emp where sal!=(select max(sal) from
emp where sal!=(select max(sal) from emp))

Is This Answer Correct ?    1 Yes 0 No

Find out the 3rd highest salary?..

Answer / vivek

SELECT v.Emp_Sal
FROM Employee_Test v
WHERE 3=
(
SELECT COUNT(DISTINCT z.Emp_Sal)
FROM Employee_Test z
WHERE v.Emp_Sal<=z.Emp_Sal
)

Is This Answer Correct ?    1 Yes 0 No

Find out the 3rd highest salary?..

Answer / shibin k abraham

select * from emp where sal=(select a.sal from emp awhere 3=(select distinct(count(b.sal)) from emp b where a.sal<=b.sal))

Is This Answer Correct ?    1 Yes 0 No

Find out the 3rd highest salary?..

Answer / priyanga.g

1) Select MAX(salary) from Programmer where salary not
in(select top 2 salary from Programmer order by salary desc)



2) Select max(salary) from programmer where salary<
(select MAX(salary) from Programmer where salary<(select
MAX(salary) from Programmer))


3) Select MAX(salary) from Programmer e where 2=(select
COUNT(*) from programmer b where b.salary>e.salary )

Is This Answer Correct ?    1 Yes 0 No

Find out the 3rd highest salary?..

Answer / ratnakar

select max(sal) from emp a where 3=(select count(sal) from
emp b where b.sal >=a.sal;

Is This Answer Correct ?    10 Yes 10 No

Find out the 3rd highest salary?..

Answer / sheik

select top 1 * from(select top 3 *from emp order by salary
desc)d order by salary asc

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

What is a constraint. Types of constraints ?

5 Answers   Accenture, BirlaSoft,


If we declare constraints Unique and Not null on a single column then it will act as a Primary key, so what is the use of primary key??

3 Answers  


Is sql better than access?

0 Answers  


What is the purpose of normalization?

0 Answers  


4. Select sum(A.salary) +sum(B.salary) as TOT_SAL from ( select LEVEL emp_id,level*100 salary,case when mod (level,2)=0then 2 else null end dept_id from dual connect by level<6 )A right outer join (select level emp_id ,level*200 salary ,case when mod (level,3)=0 then 2 else null end dept_id from dual connect by level<6)B On A.dept_id=B.dept_id And A.emp_id=B.emp-id;

1 Answers   Fintellix,






Define commit, rollback and savepoint?

0 Answers  


Is sql harder than python?

0 Answers  


What is a sql driver?

0 Answers  


What do you mean by field in sql?

0 Answers  


What is scalar and vector?

0 Answers  


Differentiate between %type and %rowtype attribute in Oracle PL/AQL programming ?

7 Answers   PreVator,


What is difference between CHAR and VARCHAR2?What is the maximum SIZE allowed for each type?

6 Answers   Saama Tech,


Categories