Query for second maximum salary in each in each department

Answer Posted / sampath pallerla

select distinct(a.sal) from emp a where 2=(select count(distinct(b.sal)) from emp b where a.sal<=b.sal);

Is This Answer Correct ?    1 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is sqlexception checked or unchecked?

541


Which column in the user.triggers data dictionary view shows that the trigger is a pl/sql trigger?

605


How to prepare for oracle pl sql certification?

577


When is a declare statement required?

677


List the ways to get the count of records in a table?

514






What is informix sql?

542


What is a crud api?

502


What are user defined functions?

586


What is sql injection vulnerability?

500


how to drop an existing table in mysql? : Sql dba

560


Which software is used for pl sql programming?

526


What are all the common sql functions?

569


Which language is used in sql?

525


What are the types of index in sql?

539


How do you create a unique index?

577