i need department wise top 2 employees salary.which logic
i will use
Answer Posted / naresh anumolu
SELECT * FROM(SELECT *,DENSE_RANK() OVER(PARTITION BY DEPTNO ORDER BY SAL DESC) AS RANK FROM EMP)A WHERE RANK<3
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What's the difference between inner join and left join?
How can you maintain the integrity of your database on instances where deleting an element in a table result in the deletion of the element(s) within another table?
Why left join is used in sql?
What is a table in a database?
Under what condition it is possible to have a page level lock and row lock at the same time for a query? : Transact sql
What is primary key and unique key?
What are the constraints available in sql?
how can we transpose a table using sql (changing rows to column or vice-versa) ? : Sql dba
How can I change database name in sql?
What does data normalization mean?
What does trigger mean in psychology?
Is left join same as join?
What are different types of indexes?
How many triggers can be applied on a table?
Can dml statements be used in pl/sql?