Query for second maximum salary in each in each department

Answer Posted / swastik

SELECT *
FROM
    (
     SELECT Ename, Deptno, Sal,
     DENSE_RANK(PARTITION BY Deptno
                ORDER BY Sal DESC
                )TopRank
     FROM Emp
     )
WHERE TopRank = 2

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the process of debugging?

543


What are the uses of sysdate and user keywords?

619


What is sql procedures and functions?

522


What does rownum mean in sql?

547


What is java sql package?

525






Are sql database names case sensitive?

493


What is varchar example?

565


How does postgresql compare to oracle/db2/ms sql server/informix?

555


How exception handling is done in advance pl/sql?

488


differentiate between float and double. : Sql dba

551


What does 0 mean in sql?

526


How is debugging done?

523


What are the types of records?

524


Why are cursors used?

574


what are date and time data types? : Sql dba

532