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

How do you write a complex sql query?

585


Is left join same as join?

520


How do I quit sql?

495


explain the delete statements in sql

578


What is difference between function and trigger?

546






Which software is used for pl sql programming?

519


What does the base_object_type column shows in the user.triggers data dictionary view?

572


Which table is left in left join?

521


What is the use of procedures?

542


what is a constraint? : Sql dba

710


Is mariadb nosql?

581


Can we use view in stored procedure?

506


What does dml mean?

543


What is rename command in sql?

465


What is the difference between row level and statement level trigger?

517