Query for second maximum salary in each in each department
Answer Posted / swas
SELECT *
FROM
(
SELECT e1.*,
DENSE_RANK() OVER(PARTITION BY Deptno
ORDER BY Sal DESC
)TopRank
FROM Emp e1
)
WHERE TopRank = 2
/
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Why do we use joins in sql?
The in operator may be used if you know the exact value you want to return for at least one of the columns.
what is the difference between a web-garden and a web-farm? : Sql dba
How is data stored on a disk?
What is materialized view in sql?
How to read/write files from pl/sql?
how can we transpose a table using sql (changing rows to column or vice-versa) ? : Sql dba
What is scalar function in sql?
how many ways to get the current time? : Sql dba
State few characteristics of pl/sql?
Why is a primary key important?
What port does sql server use?
Can we call procedure in select statement?
Which table is left in join?
What if we write return in procedure?