Query for second maximum salary in each in each department

Answer Posted / akula

select * from emp e1 where 2 =(select count(distinct(sal)) from emp e2 where e1.dno=e2.dno and e1.sal<=e2.sal);

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are inner outer left and right joins in sql?

519


What is the process of debugging?

559


What is benefit of creating memory optimized table?

545


How do I turn a list into a table?

516


Why do we use sql constraints?

664






Is pl sql better than sql?

558


What is union, minus and interact commands?

750


What normalization means?

527


What are crud methods?

553


What are sql triggers used for?

515


What is a primary key example?

520


What is a nested table in word?

534


How does sql profiler work?

574


What is number function in sql?

532


How do you use a while loop in pl sql?

543