find out the second highest salary?

Answer Posted / peter

SQL> select max(sal) sal
2 from (select sal,
3 dense_rank() over
4 (order by sal desc) rnk
5 from emp )
6 where rnk = 2;

SAL
----------
3000

SQL>

Is This Answer Correct ?    14 Yes 9 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is concurrency in oracle?

536


What are the set operators union, union all, minus & intersect meant to do?

555


What are the uses of a database trigger?

509


definition of cluster and non-clustered index?

2472


Explain the use of online redo log files in oracle.

575






How to view existing locks on the database?

540


How to drop a stored function?

670


How to run the anonymous block again?

591


What are nested tables?

663


Please explain joins in oracle?

544


What happens if the imported table already exists?

542


Is a rollback possible to any savepoint?

550


Is there any way to find out when one specific table/view/M-view is used last time. i.e. when one specific object is used in any SELECT statement.

851


how the Oracle Prepares the Execution Plan and how it chooses the Optimal one?

1816


Difference between cartesian join and cross join?

534