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

Which column in the user.triggers data dictionary view shows that the trigger is a pl/sql trigger?

1000


What is asqueryable?

917


What does trigger mean in psychology?

932


What are some predefined exceptions in pl/sql?

1113


Are views faster than queries?

947


How to add a column ‘salary’ to a table employee_details?

967


What is restrict in sql?

1060


What are commit, rollback, and savepoint?

958


can a stored procedure call itself or recursive stored procedure? : Sql dba

976


If the application is running very slow? At what points you need to go about the database in order to improve the performance?

962


What is nested table in pl sql?

1026


What are sql ddl commands?

1057


What is the most common sql injection tool?

1010


Which is faster view or stored procedure?

904


How do you optimize a stored procedure query?

966