how to get second highest salary in SQL(as/4000

Answer Posted / sreekanth

SELECT MIN(SAL)
FROM(SELECT DISTINCT SAL FROM EMP
ORDER BY SAL DESC)
WHERE ROWNUM <= :N
where n is the nth highest salary.
In most of the answers,our friends have written 'where
rownum=2',but this never retreives a row.

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is pivot table in sql?

526


How do you update a table in sql?

519


Explain the difference between drop and truncate commands in sql?

534


What is scalar data type in pl sql?

557


How to select 10 records from a table?

650






How to write a single statement that concatenates the words ?hello? And ?world? And assign it in a variable named greeting?

646


What is a record in pl/sql?

551


what is the difference between a local and a global temporary table? : Sql dba

555


Enlist the characteristics of pl/sql?

1245


How many types of cursors supported in pl/sql?

596


What is form and report?

519


Is it possible to create startup or shutdown trigger for on-schema?

587


Can we insert delete data in view?

545


What is an invalid partition table?

566


How many clustered indexes can be created on a table?

595