how to find the second highest salary from emp table?

Answer Posted / erp_guns

SELECT MAX(sal) from emp a where &n=(select COUNT(DISTINCT
(SAL)) from emp b where a.sal<=b.sal)

Is This Answer Correct ?    39 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is sql between inclusive?

590


Can I join the same table twice?

526


What is difference between procedure and trigger?

519


What is the largest value that can be stored in a byte data field?

521


what are myisam tables? : Sql dba

552






Can we use insert statement in function?

516


Why left join is used in sql?

519


What is the difference between having clause and where clause?

572


What is clustered and nonclustered index in sql?

503


How can you get sql*loader to commit only at the end of the load file? : aql loader

556


What is denormalization in a database?

593


What is the best sql course?

534


How to select 10 records from a table?

650


What is package in pl sql?

579


How to use transactions efficiently : transact sql

548