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
Why use subqueries instead of joins?
What is primary key and foreign key?
What is the basic structure of an sql?
What is difference between stored procedure and trigger?
how many ways we can we find the current date using mysql? : Sql dba
What is the cause of mutating table error and how can we solve it?
What is self-join and what is the requirement of self-join?
Do stored procedures prevent sql injection?
What does select top 1 do in sql?
How much ram can sql express use?
Does sql full backup truncate logs?
Explain architecture of sql server notification services?
How delete a row in sql?
How to get unique records from a table?
How to add new employee details in an employee_details table with the following details