Query for second maximum salary in each in each department

Answer Posted / jairam

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 ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between execution of triggers and stored procedures?

552


How does a covering index work?

531


What is record data type?

517


Are sql connections encrypted?

558


what are all the different types of indexes? : Sql dba

530






What does fetching a cursor do?

615


Explain the purpose of %type and %rowtype data types?

503


Can sql function call stored procedure?

558


what are the different type of normalization? : Sql dba

556


What is bind reference and how can it be created?

580


What is the difference between local and global temporary table?

553


Is sql a case sensitive language?

516


What action do you have to perform before retrieving data from the next result set of a stored procedure ?

2095


where are cookies actually stored on the hard disk? : Sql dba

582


What normalization means?

527