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
Is foreign key mandatory?
Why use subqueries instead of joins?
What is not in sql?
How do you sort in sql?
What is cartesian join in sql?
Explain the difference between cursor declared in procedures and cursors declared in the package specification?
what is the functionality of the function htmlentities? : Sql dba
What is the usage of nvl function?
Is json a nosql?
give the syntax of grant and revoke commands? : Sql dba
how can we know the count/number of elements of an array? : Sql dba
How can I speed up sql query?
How much does sql certification cost?
How many types of cursors are available in pl/sql?
What is online transaction processing (oltp)?