how to find the second highest salary from emp table?

Answer Posted / shrikant

You can find nth max salary

change "limit 0,n" where n = 1,2,3...

select b.sal from (select a.sal from (select distinct sal
from emp order by sal desc) a limit 0,n) b order by sal asc
limit 0,1;

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which join condition can be specified using on clause?

517


What is error ora-12154: tns:could not resolve the connect identifier specified?

595


What is the main reason behind using an index?

560


Can I join the same table twice?

529


how to implement one-to-one, one-to-many and many-to-many relationships while designing tables? : Sql dba

551






How to avoid duplicate records in a query?

579


What are the main features of cursor?

631


Do ddl statements need commit?

540


Is sql an operating system?

545


Is t sql a programming language?

541


Explain about various levels of constraint.

525


Explain what is sql*plus?

670


Why select is used in sql?

522


What is the difference between union and union all command?

556


When are we going to use truncate and delete?

555