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


Please Help Members By Posting Answers For Below Questions

How many clustered indexes can you have?

529


What is a temporal data type?

593


How do I upgrade sql?

544


Why do we create views in sql?

551


What is benefit of creating memory optimized table?

537






How many joins can you have in sql?

517


Which is faster subquery or join?

658


What is database white box testing and black box testing?

634


What is a primary key sql?

559


what is a relationship and what are they? : Sql dba

550


Can we use the cursor's to create the collection in PL/SQL?

516


What is the difference between sum and count in sql?

520


what is transaction? : Sql dba

530


Can a view be mutating? If yes, then how?

572


What is insert command in sql?

526