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
What are the types of operators available in sql?
Can we join tables without foreign key?
How can you know that statistics should be updated?
Why procedure is used in sql?
What are all the common sql functions?
what is the command used to fetch first 5 characters of the string? : Sql dba
how many groups of data types? : Sql dba
What is the difference between drop and truncate commands?
What is pl sql collection?
How to process query result in pl/sql?
How do you delete a table?
How do you explain an index number?
What is the difference between rollback and rollback to statements?
Can primary key be changed?
Explain what is rdbms?