Find out the 3rd highest salary?

Answers were Sorted based on User's Feedback



Find out the 3rd highest salary?..

Answer / ritesh sabanis

select max(sal) from employeedata where sal <
(select max(sal) from employeedata where sal not in(select
max(sal)from employeedata)) ;

Is This Answer Correct ?    0 Yes 0 No

Find out the 3rd highest salary?..

Answer / divya c

Select max(sal) from emp
where sal<(select max(sal) from emp where sal<(select max
(sal) from emp));

Is This Answer Correct ?    0 Yes 0 No

Find out the 3rd highest salary?..

Answer / lalit dwivedi

select a.salary
from emp a
where 3=(select count(distinct(b.salary))
from emp b
where a.salary<=b.salary)

Is This Answer Correct ?    1 Yes 1 No

Find out the 3rd highest salary?..

Answer / dharmendra yadav

select min(salary) from (select name , salary , rownum from
Emp order by salary desc) where rownum <= 3 ;

Is This Answer Correct ?    1 Yes 1 No

Find out the 3rd highest salary?..

Answer / jeevitha

select distinct a.salfrom emp a where &n= (select count
(distinct(b.sal)from emp b where a.sal<= b.sal)
-----
enter the highest sal of n:2,3.....n

Is This Answer Correct ?    1 Yes 1 No

Find out the 3rd highest salary?..

Answer / suba

(Instead of 3 we can find N highest value)

select min(sal) from emp e where 3>(select count(sal) from
emp where sal>e.sal);

Is This Answer Correct ?    0 Yes 0 No

Find out the 3rd highest salary?..

Answer / kumar

select*from(select rownum rn,sal from(select*from emp order by sal desc))where rn=3

Is This Answer Correct ?    0 Yes 0 No

Find out the 3rd highest salary?..

Answer / aarti verma

get the 3rd highest salary:

SELECT DISTINCT salary from employee e ORDER BY salary DESC
LIMIT 2,1;

get the records of employees having 3rd highest salary:

SELECT * FROM employees WHERE salary = (SELECT DISTINCT
salary from employee e ORDER BY salary DESC LIMIT 2,1);

Is This Answer Correct ?    0 Yes 0 No

Find out the 3rd highest salary?..

Answer / himanshu

SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP 3 salary
FROM employee
ORDER BY salary DESC) a
ORDER BY salary

Is This Answer Correct ?    0 Yes 0 No

Find out the 3rd highest salary?..

Answer / vikram kumar

SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP 3 salary
FROM employee
ORDER BY salary DESC) a
ORDER BY salary

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

What do you understand by pl/sql packages?

0 Answers  


What is oracle sql developer?

0 Answers  


what is a relationship and what are they? : Sql dba

0 Answers  


How do I start sql from command line?

0 Answers  


Suppose a student column has two columns, name and marks. How to get name and marks of the top three students.

0 Answers  






What is a database trigger ? Name some usages of database trigger ?

4 Answers  


What is oracle ? why we should go for oracle database instead of diffrent databases available in the industry.

5 Answers   Polaris,


What kind of join is join?

0 Answers  


Does access use sql?

0 Answers  


how many values can the set function of mysql take? : Sql dba

0 Answers  


What are the set operators in sql?

0 Answers  


I have 2 Databases. How can create a table in particular database? How can i know the list of tables presented each database?( in oracle 10g)

5 Answers   Relq,


Categories