Anybody can tell me, how do we find second largest emp
salary from emp table.. Thanks in advance ...

Answer Posted / hemalatha

Following is the query to find the nth maximum salary:

select * from emp
where sal=(select distinct(sal) from emp a
where &n=(select count(sal)from emp
where sal>=a.sal;))

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What privilege is needed for a user to create views in oracle?

589


What are the different pseudo commands? Explain in general?

541


What is the difference between I and G in Oracle?

603


1) What is ONE_SIZE_FITS_ALL approach? 2) Explain the Common & Variable Header of DATA FILE? 3) What are the Drawbacks to using OMF DB? and the Advantages? 4) List out the Advantages of Undo T.spaces over the Undo SEGMENT? 5) Difference between the Temporary tablespace with TEMPFILE and the Tablespace with TEMPORARY Keyword? 6) What are the situation extents are freeing for reuse.

1609


What is oracle data type?

555






What is tns service name?

622


How to pass a parameter to a cursor in oracle?

595


you are a universe designer and report developer in BO, what type of information you gather from client?Briefly explain plz

1562


how can db_files > maxdatafiles since db_files is for instance and the later is for database

2173


How to fetch the row which has the max value for a column?

538


What is the difference between $oracle_base and $oracle_home?

585


How to do paging with oracle?

574


How to start an oracle instance?

574


How to delete a column in an existing table?

593


Is there an oracle sql query that aggregates multiple rows into one row?

544