Query for second maximum salary in each in each department
Answer Posted / manju
select deptno,Max(e1.sal) from emp e1
where e1.sal NOT IN(
select Max(e2.sal) from emp e2
group by e2.deptno
)
group by e1.deptno
| Is This Answer Correct ? | 13 Yes | 10 No |
Post New Answer View All Answers
How do I pipe the output of one isql to another?
What is t-sql? : Transact sql
What is a left join?
how do you control the max size of a heap table? : Sql dba
What is a rank in sql?
What is coalesce sql?
what is a database lock ? : Sql dba
is mysql query is case sensitive? : Sql dba
how to use like conditions? : Sql dba
What is clustered and nonclustered index in sql?
Which table is left in left join?
How to generate a salary slip like jan 1000 1000 feb 1000 2000 ... dec 1000 12000
what is view? : Sql dba
What does the sign mean in sql?
What is benefit of creating memory optimized table?