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
Is sql considered coding?
What is using in sql?
What is sql integrity?
Which operator is used in query for pattern matching?
Enlist some predefined exceptions?
What is output spooling in sql*plus?
How do I run a sql script?
What is difference between procedure and trigger?
Can we insert in view in sql?
What is difference between group by and partition by?
Explain clause in sql?
Why triggers are used?
Why do we use triggers?
how do you control the max size of a heap table? : Sql dba
What is cursor status?