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

Answer Posted / vikas kapoor

select deptno,sal from
(select deptno,sal,row_number() over(partition by deptno orderby sal) r from emp ) where r<3

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I view tables in sql developer?

680


Can unique keys be null?

662


Why do we need view in sql?

730


Is subquery faster than join?

739


what happens when the column is set to auto increment and you reach the maximum value for that table? : Sql dba

765






What is Histogram?

1273


What is the difference between an inner and outer join?

729


How do I run a script in sql developer?

703


What is the difference between nested table and varray?

687


How does left join work in sql?

700


What is primary key sql?

713


List different type of expressions with the example.

698


What is package in pl sql?

735


how to enter binary numbers in sql statements? : Sql dba

702


How do sql databases work?

707