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 materialized view in sql?
Does oracle use sql?
What is a dynamic query?
what are the other commands to know the structure of table using mysql commands except explain command? : Sql dba
How to generate a salary slip like jan 1000 1000 feb 1000 2000 ... dec 1000 12000
List the various privileges that a user can grant to another user?
- Types of triggers - View - Dcl - Procedures, packages, functions - Metasolve - Can use Dcl in triggers - package case study - Cursor and its types - triggers schedule - Wrap - Why we are using fetch and for in cursor. difference?
What are the two types of exceptions in pl/sql?
How do I view a table in sql?
what are the join types in tsql? : Transact sql
What is normalization in sql?
how to check server status with 'mysqladmin'? : Sql dba
What are the most important characteristics of pl/sql?
Which is better trigger or stored procedure?
Is pl sql different from sql?