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
Can a foreign key have a different name?
How can a pl sql block be executed?
When do we use triggers?
what are the maximum number of rows that can be constructed by inserting rows directly in value list? : Transact sql
What is trigger with example?
How exception handling is done in advance pl/sql?
What is the purpose of cursors in pl/sql?
How does postgresql compare to mysql?
What is a recursive join sql?
What is graph sql?
Can we alter stored procedure?
How do you modify a column in sql?
Write a sql query to convert all character to uppercase after hypen.
What is an invalid partition table?
Is primary key clustered or nonclustered?