find out the second highest salary?
Answer Posted / hari kanth
select sal from(select sal,rank() over(order by sal desc)
rnk from emp) e
where e.rnk=2;
(OR)
select rownum,sal from emp group by sal,rownum
having rownum=2;
(OR)
select rn,sal from( select rownum rn,sal from emp group by
sal,rownum order by sal desc)
where rn=2;
| Is This Answer Correct ? | 3 Yes | 3 No |
Post New Answer View All Answers
How to use subqueries in the from clause in oracle?
How to connect asp pages to oracle servers?
How can I see all tables in oracle?
 How to use an oracle sequence generator in a mapping?
How do I find my oracle client driver version?
What is oracle rownum?
Oracle
How to create a stored function in oracle?
What is private procedure oracle?
What is the parameter mode that can be passed to a procedure?
various types of hints and their usage
Explain the different normalization forms?
Is oracle the best database?
How to best split csv strings in oracle 9i?
Please explain drop constraint oracle?