Query for second maximum salary in each in each department

Answer Posted / ram

SELECT empno,salary,dept_id FROM (SELECT empno,salary,dept_id,DENSE_RANK() OVER (PARTITION BY Dept_id ORDER BY Salary DESC)
as Rnk FROM emp) WHERE Rnk = 2;

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write the command to remove all players named sachin from the players table.

727


Is merge a dml statement?

516


What is foreign key sql?

546


How can you save or place your msg in a table?

517


Can a trigger call a stored procedure?

530






Which are the different case manipulation functions in sql?

528


What is database migration?

513


explain about mysql and its features. : Sql dba

541


Does a primary key have to be a number?

512


How do I run a program in pl sql?

493


I need a function for a train ticket reservation please answer it thanks in advance

559


What is the starting oracle error number?

562


Can you join views in sql?

534


what are the authentication modes in sql server? How can it be changed? : Sql dba

694


What does desc stand for?

584