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 are the different types of dbms?
What is trigger in sql? Explain
why does the selected column have to be in the group by clause or part of an aggregate function? : Sql dba
Do we need commit after truncate?
which tcp/ip port does sql server run on? : Sql dba
What is difference between my sql and sql?
what does it mean to have quoted_identifier on? What are the implications of having it off? : Sql dba
What is not in sql?
How to check if a column is nullable before setting to nullable?
What is serial sql?
What are pl/sql cursor exceptions?
what are aggregate and scalar functions? : Sql dba
When is a declare statement required?
What is date functions?
Can a procedure in a package be overloaded?