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
Why are indexes and views important to an organization?
how does a local variable is defined using t-sql? : Transact sql
How do I find duplicates in a single column in sql?
How does one use sql*loader to load images, sound clips and documents? : aql loader
What does pl sql developer do?
what is the use of set statement in tsql? : Transact sql
Can a varchar be a primary key?
How many subqueries can be nested in a statement?
How do I view a view in sql?
What is orm in sql?
explain the options of myisamchk to improve the performance of a table. : Sql dba
Explain the uses of database trigger.
Which command is used to call a stored procedure?
How many commands are in sql?
What does subquery mean in sql?