how to find out second largest value in the table

Answer Posted / sandeep

select * from (select ename,sal,rank() over(order by sal desc) as ranks from emp)
where ranks=2;

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I spool to a csv formatted file using sqlplus?

621


What is key preserved table?

651


what is meant by magic query

1860


How to define an anonymous procedure without variables?

630


How to rename a tablespace in oracle?

712






What is the usage of control file in oracle?

701


Why should I use oracle database?

654


Can select statements be used on views in oracle?

673


Explain the use of control file?

738


What is a trigger and what are its types?

689


Is oracle the best database?

613


What is save point in oracle database?

838


How to synchronize 2 schema's objects?

1776


How to use subqueries in the from clause in oracle?

656


How to count duplicated values in a column in oracle?

636