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 to start oracle sql developer?

568


What are sql triggers used for?

519


what are the differences between get and post methods in form submitting. Give the case where we can use get and we can use post methods? : Sql dba

682


What is a pl/sql block?

603


How can we find duplicate records in a table?

522






What is materialized view in sql?

471


Is pl sql a scripting language?

601


Which sql statement is used to delete data from a database?

480


Define concurrency control. : Transact sql

593


How do you break a loop in pl sql?

533


Can we create a trigger on view?

499


what are date and time data types? : Sql dba

544


how can we submit a form without a submit button? : Sql dba

549


how to rename an existing table in mysql? : Sql dba

584


Which is faster union or join?

506