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 procedural language?

546


Why use truncate instead of delete?

535


What is the use of triggers?

530


What normalization means?

514


Define join and name different types of joins?

509






How to fetch alternate records from a table?

671


Explain cursor types?

570


Is coalesce faster than isnull?

496


Compare sql & pl/sql

598


How do you drop a trigger?

533


What is sql and how does it work?

534


What does plv msg allows you to do?

660


What is the usage of sql functions?

531


What is secondary key?

502


The in operator may be used if you know the exact value you want to return for at least one of the columns.

550