i need department wise top 2 employees salary.which logic
i will use

Answer Posted / ramya p

select deptno, max(sal) from (select * from emp order by
sal desc)
where rownum < 3
group by deptno
order by max(sal) desc;

Is This Answer Correct ?    5 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which join condition can be specified using on clause?

702


Why do we need cursors in pl sql?

721


What does partition by mean in sql?

690


What is a .db file?

724


How many aggregate functions are available there in sql?

701






How do I count rows in sql query?

690


How many primary keys can a table have?

722


What is sql constant?

677


Why function is used in sql?

679


What is insert command in sql?

778


What sql does db2 use?

726


List out the acid properties and explain?

711


Is not equal in sql?

754


What are the benefits of pl/sql packages?

740


What are different methods to trace the pl/sql code?

740