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 one is better sql or oracle?

503


What is sql*loader?

576


How to pronounce postgresql?

584


What is ttitle and btitle?

576


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

581






what is 'trigger' in sql? : Sql dba

559


What is not equal in sql?

511


How to return an array from java to pl/sql?

593


What is the use of prepared statement?

540


which types of join is used in sql widely? : Sql dba

542


What are analytic functions in sql?

552


Why triggers are used?

557


Explain the advantages and disadvantages of stored procedure?

653


What is sqlexception in java?

551


what is collation? : Sql dba

616