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 happens if you set the sga too low in oracle?

562


Database crashes. Corruption is found scattered among the file system neither of your doing nor of Oracles. What database recovery options are available? Database is in archive log mode.

1549


What are the various oracle database objects?

683


What is oracle rownum?

522


Why is oracle so popular?

567






What are the different types of failures that occur in Oracle database?

606


What is oracle database client?

561


Please explain oracle data types with examples?

592


How do we get field detail of a table?

631


What is an oracle user role?

574


What is hot backup and logical backup?

614


how to convert .db (extention) database file into .dmp (extention ) for oracle database ?

2071


What is SQL Tuning Advisor in Oracle?

637


How to create a table index?

572


How do we display rows from the table without duplicates?

554