how to find the second highest salary from emp table?

Answer Posted / subash pandey

SELECT salary
FROM employee e
WHERE n = (
SELECT count( * )
FROM employee
WHERE salary > e.salary )

n=1 or 2 or 3 n is level which level max salary you want
i test this it proper work

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many unique keys can a table have?

552


Why do we create stored procedures & functions in pl/sql and how are they different?

500


Why self join is used in sql?

495


Are sql connections encrypted?

554


How can we find duplicate records in a table?

512






What is an inner join sql?

542


Does sql require a server?

525


What is error ora-01000: maximum open cursors exceeded

598


Are left and right joins the same?

529


What is a mutating table and a constraining table?

567


What are the different types of dbmss?

557


How do I access sql anywhere database?

495


Whis is not false in primary key?

975


What is a clob in sql?

563


Which constraints we can use while creating database in sql?

611