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

Answer Posted / shyam

select * from
(select ename,job,sal,deptno,
dense_rank()
over(partition by deptno order by sal desc) densrank
from emp)
where densrank<=2;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what are the types of subquery? : Sql dba

584


what is the difference difference between procedure and packages

9213


what is an alias command? : Sql dba

544


What is a primary key called that is made up of more than one field?

789


How do you modify a table in sql?

560






what is 'mysqldump'? : Sql dba

570


What does stand for in sql?

522


What does sql stand for?

542


What is sql character function?

539


Show the two pl/sql cursor exceptions.

612


What does select count (*) mean in sql?

545


What is pl sql block structure?

539


Can we use pl sql in mysql?

517


Can function return multiple values in sql?

524


What is microsoft t sql?

489