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...

Query for second maximum salary in each in each department

Answer Posted / swas

SELECT *
FROM
    (
     SELECT e1.*,
     DENSE_RANK() OVER(PARTITION BY Deptno
                ORDER BY Sal DESC
                )TopRank
     FROM Emp e1
     )
WHERE TopRank = 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 a composite primary key?

1085


Difference between global and parameter variables?

1963


discuss about myisam index statistics collection. : Sql dba

949


hi,i plan to put experience on PLSQL ,can anyone suggest me for any institutes in bangalore or how to prepare for interviews

2012


what are all types of user defined functions? : Sql dba

1042


What are pl/sql cursor exceptions?

1098


what is sql in mysql? : Sql dba

1185


Is sqlite thread safe?

1043


What does (+) mean in sql joins?

1059


How many sql commands are there?

1114


Can we create foreign key without primary key?

981


Explain foreign key in sql?

1018


What is difference between db2 and sql?

997


What is optimistic concurrency control? : Transact sql

981


How do I view a procedure in sql?

963