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

Is foreign key mandatory?

1058


Why use subqueries instead of joins?

1131


What is not in sql?

996


How do you sort in sql?

1062


What is cartesian join in sql?

1186


Explain the difference between cursor declared in procedures and cursors declared in the package specification?

1216


what is the functionality of the function htmlentities? : Sql dba

1001


What is the usage of nvl function?

1098


Is json a nosql?

1027


give the syntax of grant and revoke commands? : Sql dba

1215


how can we know the count/number of elements of an array? : Sql dba

1104


How can I speed up sql query?

1002


How much does sql certification cost?

1132


How many types of cursors are available in pl/sql?

1156


What is online transaction processing (oltp)?

1057