select top 3 sal from each dept?

Answer Posted / chiru

select *
from (select row_number() over(partition by deptno order by sal desc) r,
b.*
from (select rownum num, a.* from emp a order by sal desc) b)
where r <= 3

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you take the union of two tables in sql?

511


What is oracle sql developer?

601


Is sql a microsoft product?

492


What is the difference between execution of triggers and stored procedures?

548


What are the packages in pl sql?

566






Can ddl statements be used in pl/sql?

591


Does truncate free space?

515


what is column? : Sql dba

566


What is the difference between rollback and rollback to statements?

574


What are the benefits of pl sql?

521


What are different joins used in sql?

548


What is sql injection owasp?

543


How delete all data from table in sql?

567


Write a query to find the names of users that begin with "um" in sql?

498


What is sql partition function?

610