Write a query to get 2nd maximum salary in an employee table ?

Answer Posted / niladri saha(oracle apps consu

SELECT EMP_NAME EmployeeName, SAL Salary
FROM EMP
WHERE SAL =
( SELECT SAL
FROM
(
SELECT
DISTINCT SAL
FROM EMP
ORDER BY SAL DESC
)
WHERE ROWNUM=2
);

This Query will list all the employees, having second
highest salary.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to raise user-defined exception with custom sqlerrm ?

682


Explain how can you save or place your msg in a table?

597


What is the difference between jpql and sql?

555


What company owns postgresql?

562


how to convert character strings to dates? : Sql dba

530






Explain spool.

691


What is sql basics?

588


What is trigger price?

546


What are the properties of a transaction?

573


How do we use distinct statement? What is its use?

558


What is foreign key sql?

557


What is the difference between explicit and implicit cursors in oracle?

518


how many sql ddl commands are supported by 'mysql'? : Sql dba

531


how to include comments in sql statements? : Sql dba

547


How to use sql*plus built-in timers?

578