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
What are sql constraints?
Can we join more than 2 tables in sql?
what are the limitations of mysql in comparison of oracle? Mysql vs. Oracle. : Sql dba
What are the types of functions in sql?
What is materialized view. What are different methods of refresh?
Determine if oracle date is on a weekend?
Under what condition it is possible to have a page level lock and row lock at the same time for a query? : Transact sql
What is the plv (pl/vision) package offers?
How can check sql version from command line?
How many sectors are in a partition?
What are aggregate functions in sql?
What are the main features of cursor?
Does sql between include endpoints?
Is primary key clustered index?
How many types of index are there?