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
What is pivot table in sql?
How do you update a table in sql?
Explain the difference between drop and truncate commands in sql?
What is scalar data type in pl sql?
How to select 10 records from a table?
How to write a single statement that concatenates the words ?hello? And ?world? And assign it in a variable named greeting?
What is a record in pl/sql?
what is the difference between a local and a global temporary table? : Sql dba
Enlist the characteristics of pl/sql?
How many types of cursors supported in pl/sql?
What is form and report?
Is it possible to create startup or shutdown trigger for on-schema?
Can we insert delete data in view?
What is an invalid partition table?
How many clustered indexes can be created on a table?