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

What is db journal file?

524


What is the use of %rowtype?

539


What is a dirty read sql?

489


how to add a new column to an existing table in mysql? : Sql dba

589


what is single byte over head in oracle..?

1874






Which are the different types of indexes in sql?

563


How do you remove duplicates without using distinct in sql?

508


How is a process of pl/sql compiled?

603


Explain spool.

691


What is the difference between distinct and unique in sql?

476


what are the different tables present in mysql? : Sql dba

507


Why is pl sql used?

531


How do you determine the current isolation level? : Transact sql

584


What does over partition by mean in sql?

538


Which join condition can be specified using on clause?

518