how to find the second highest salary from emp table?
Answer Posted / ramesh lavanuru
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 ? | 52 Yes | 63 No |
Post New Answer View All Answers
What are the indexing methods?
Does mysql_real_escape_string prevent sql injection?
how would you get the current date in mysql? : Sql dba
How do I view a sql trace file?
Can we insert in sql function?
How to generate a salary slip like jan 1000 1000 feb 1000 2000 ... dec 1000 12000
Explain autonomous transaction.
tell me about various levels of constraint. : Sql dba
What is sql procedures and functions?
When can we use the where clause and the having clause?
what are the types of join and explain each? : Sql dba
What is the use of function in sql?
What is a table partition?
What's the difference between a primary key and a clustered index?
What does count (*) mean?