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


Please Help Members By Posting Answers For Below Questions

How can you load microsoft excel data into oracle? : aql loader

799


What is the use of %rowtype?

734


How do I count rows in sql query?

679


What is database sql?

698


What does select top 1 do in sql?

715






how to fetch alternate records from a table? : Sql dba

813


How many parts of a pl sql block are optional?

700


How can we find duplicate records in a table?

656


What is rownum and rowid?

748


What is sql basics?

769


how many triggers are allowed in mysql table? : Sql dba

744


What is write ahead logging in sql server?

736


What is sql profiling in oracle?

726


What is sql and how does it work?

722


Explain sql data types?

821