how to find the second highest salary from emp table?

Answer Posted / naveed saleh

You can use this for getting nth highest salary from
Employee table as follows

SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP n salary
FROM employee
ORDER BY salary DESC) a
ORDER BY salary
where n > 1 (n is always greater than one)

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we use ddl commands in pl sql?

552


What are two statement types in sql?

533


how many columns can be used for creating index? : Sql dba

511


How to install oracle sql developer?

560


How to add, remove, modify users using sql?

553






Can a foreign key be a duplicate?

499


What are the types of records?

526


Explain the advantages and disadvantages of stored procedure?

641


What are different types of triggers?

551


How to use distinct and count in sql query? Explain

604


What are the different types of database management systems?

524


What is hibernate and its relation to sql?

587


what is schema? : Sql dba

560


What are database links used for?

591


Mention what is the use of function "module procedure" in pl/sql?

559