how to find the second highest salary from emp table?

Answer Posted / ravi

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

where n is the nth highest salary

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is data definition language?

619


What is the use of sqldataadapter?

532


How can a pl sql block be executed?

528


Explain lock escalation? : Transact sql

702


What does desc stand for?

588






What is the non-clustered index in sql?

587


Which is better varchar or nvarchar?

546


How to order siblings in oracle hierarchy queries?

597


what are wild cards used in database for pattern matching ? : Sql dba

546


Why having clause is used in sql?

536


what are the different tables present in mysql? : Sql dba

502


How exception is different from error?

539


Write a sql query to get the third highest salary of an employee from employee_table?

630


What are triggers in sql?

578


Is not null in sql?

558