Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 is vector point function?

1001


What is clause?

1062


what is the difference between rownum pseudo column and row_number() function? : Sql dba

1018


What is auto increment in sql?

1060


How does index help in query performance?

966


What is dbo in sql?

918


What is the difference between local and global temporary table?

986


Write a program that shows the usage of while loop to calculate the average of user entered numbers and entry of more numbers are stopped by entering number 0?

2226


What are inner and outer joins examples of both?

878


How delete all data from all tables in sql?

883


Is drop table faster than truncate?

939


What are the benefits of triggers?

1119


Are stored procedures faster than dynamic sql?

978


Why we use joins in sql?

924


how to rename an existing table in mysql? : Sql dba

1004