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

how does a local variable is defined using t-sql? : Transact sql

549


What is sql server and ase?

544


What problem one might face while writing log information to a data-base table in pl/sql?

560


What are different types of functions in sql?

513


How many primary keys can a table have?

534






Difference between table function and pipelined function?

589


What are the types of operators available in sql?

554


Why commit is not used in triggers?

587


How can I get the number of records affected by a stored procedure?

581


What is a boolean in sql?

526


What is java sql package?

543


Explain the update statement in sql

565


Is sql a programming?

550


Explain the uses of a database trigger?

576


Explain 3 basic parts of a trigger.

843