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 / swaraj

Select Department,Max(Salary)
From (Select E1.Department,E1.Salary
From Employee E1,(Select Department,Max(Salary) as Salary
From Employee group by Department) E2
Where E1.Department = E2.Department
And E1.Salary<E2.Salary) E
Group by Department

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we join two tables without common column?

926


Why stored procedure is faster than query?

946


Does pl sql work in mysql?

918


How can we store rows in PL/SQL using array?

1158


What does an inner join do?

1089


explain the difference between delete , truncate and drop commands? : Sql dba

1012


What is cross join example?

940


what is the difference difference between procedure and packages

10244


What is a common use of group by in sql?

994


What is pl sql package?

990


Can I learn sql in a week?

1003


What does inner join mean?

1053


What does trigger mean in slang?

998


Is primary key always clustered index?

944


What is the difference between local variables and global variables?

1065