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 type of join is sql join?

919


How do you go back in sql?

939


What are the uses of sysdate and user keywords?

1046


Do ddl statements need commit?

919


Why is nosql good?

973


What is sql and db2?

938


What is structural independence and why is it important?

978


Differentiate pl/sql and sql?

1010


Can we call dml statement in function?

976


What are the different types of a subquery?

980


Explain the rollback statement?

961


What are actual parameters and formal parameters?

1033


What is a Mapplet?

1054


how does a local variable is defined using t-sql? : Transact sql

945


What is a natural join?

988