how to find the second highest salary from emp table?

Answer Posted / neeraj

SELECT DISTINCT(SAL) FROM EMP
WHERE SAL=(SELECT MIN(SAL) FROM (SELECT SAL FROM EMP ORDER
BY SAL DESC)
WHERE ROWNUM<=2);

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why indexing is needed?

519


What is difference between stored procedures and application procedures?

574


How to Declare Fixed Length String Value In PL SQL

668


Is it possible to include an insert statement on the same table to which the trigger is assigned?

567


What is multiple columns?

576






what is column? : Sql dba

578


What is normalization? How many normalization forms are there?

556


What are different types of queries in sql?

529


Can we use ddl statements in stored procedure?

701


How do temporal tables work?

521


What mean sql?

585


What trigger means?

569


What is a composite primary key?

588


Can a composite key be null?

532


Is it possible to remove child records without removing master table records...the two having pk,fk relationship?

811