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

What are the operators used in select statements?

578


What has stored procedures in sql?

605


what are the different tables present in mysql? : Sql dba

507


What do you mean by “trigger” in sql?

626


Why query optimization is needed?

521






How to read xml file in oracle pl sql?

511


Explain architecture of sql server notification services?

624


What is the primary use of normalization?

533


How do you truncate?

507


what is auto increment? : Sql dba

578


how many values can the set function of mysql take? : Sql dba

539


What is the need of merge statement?

557


Can you upgrade sql express to full sql?

520


How to use distinct and count in sql query? Explain

616


What is exception? What are the types of exceptions?

558