how to find the second highest salary from emp table?
Answer Posted / mohammed irfan
SELECT sal1 "salary"
FROM (SELECT ROWNUM rownum1 ,sal1
FROM (SELECT sal sal1
FROM emp
ORDER BY sal DESC
)
)
WHERE rownum1=:p_highest;
Note:- 'p_highest' here we can give the number as we want
to display the highest salary.
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What is pls_integer in pl sql?
How exception handling is done in advance pl/sql?
What is the importance of sqlcode and sqlerrm?
what is the difference between ereg_replace() and eregi_replace()? : Sql dba
Is there a way to automate sql execution from the command-line, batch job or shell script?
Write a sql query to find the names of employees that begin with ‘a’?
What is sql performance tuning?
Describe sql comments?
How do I view a table in sql?
What is sql profiling in oracle?
Is it possible to pass parameters to triggers?
Does sql*plus also have a pl/sql engine?
Is oracle sql free?
Which certification is best for sql?
What is autocommit sql?