Write a query to find second highest salary of an employee.

Answers were Sorted based on User's Feedback



Write a query to find second highest salary of an employee. ..

Answer / preetir

select min(sal) from (select distinct sal from emp order by
desc where rownum < 2)

Is This Answer Correct ?    0 Yes 2 No

Write a query to find second highest salary of an employee. ..

Answer / arif saulat

select * from emp where sal <(select max(sal) from emp)

Is This Answer Correct ?    0 Yes 2 No

Write a query to find second highest salary of an employee. ..

Answer / deepshikha

SELECT MAX (sal)
FROM emp a,
(SELECT MAX (sal) max_sal
FROM emp) abc
WHERE a.sal < abc.max_sal
ORDER BY sal DESC;

Is This Answer Correct ?    0 Yes 3 No

Write a query to find second highest salary of an employee. ..

Answer / vamana murthy

select ename,salary from emp
where rownum=2
order by salary desc

Is This Answer Correct ?    0 Yes 7 No

Write a query to find second highest salary of an employee. ..

Answer / amol londhe

Use the below Query:

Select Max(salary) from Emp
Where Max(salary) < (Select Max(salary) from emp
where emp-no=101);

Is This Answer Correct ?    10 Yes 18 No

Write a query to find second highest salary of an employee. ..

Answer / kitcat

SELECT salary
FROM (SELECT salary FROM emp
ORDER BY DESC salary)
WHERE RowNum=2

Is This Answer Correct ?    1 Yes 11 No

Write a query to find second highest salary of an employee. ..

Answer / jeff

select max(salary)
from Emp
where rownum < 2;

Is This Answer Correct ?    3 Yes 19 No

Post New Answer

More SQL PLSQL Interview Questions

How do I write a cron which will run a sql query and mail the results to agroup?

0 Answers  


What does “select count(*) from tab” result?

15 Answers   IBM, Student, Wipro,


Can we use pl sql in sql server?

0 Answers  


How many developers work on postgresql?

0 Answers  


Can we use loop in sql?

0 Answers  






Can we connect to postgresql using sql developer?

0 Answers  


What is a schema in sql?

1 Answers  


How to write a single statement that concatenates the words ?hello? And ?world? And assign it in a variable named greeting?

0 Answers  


How does sql store data?

0 Answers  


What is an intersect?

0 Answers  


What is sql dialect?

0 Answers  


How to select unique records from a table?

0 Answers  


Categories