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
What is an inner join sql?
What is sql indexing?
what is column? : Sql dba
What is informix sql?
what are string data types? : Sql dba
Is record in oracle pl sql?
what is view? : Sql dba
List the ways to get the count of records in a table?
explain the difference between bool, tinyint and bit. : Sql dba
what is a unique key ? : Sql dba
What schema means?
How do you concatenate in sql?
what is the stuff function and how does it differ from the replace function? : Sql dba
What does truncate mean in sql?
What are the conditions an underlying table must satisfy before a cursor can be used by a positioned update or delete statement? : Transact sql