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 are secondary keys?
What are records give examples?
what is the difference between truncate and delete statement? : Transact sql
How many clustered indexes can be created on a table?
How many triggers can be applied on a table?
Why is %isopen always false for an implicit cursor?
How many sectors are in a partition?
what is the difference between cluster and non cluster index? : Sql dba
Name three sql operations that perform a sort.
What is where clause in sql?
What is t-sql? : Transact sql
What is sql select statement?
What is a pl/sql block?
What is recursive join in sql?
what is online transaction processing (oltp)? : Sql dba