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 a full join sql?
What are the types of operators available in sql?
what is the difference between mysql_fetch_object and mysql_fetch_array? : Sql dba
What is the purpose of the sql select top clause?
Can we change the table name in sql?
What is view? Can we update view
How many types of index are there?
What is procedure in pl sql?
What can you do with pl sql?
What is the purpose of the primary key?
What are character functions?
Explain constraints in sql?
Is id a reserved word in sql?
explain commit and rollback in mysql : sql dba
Why sql query is slow?