how to retrieve the top 3 salaries of the table using rownum

Answer Posted / nitesh

select sal from emp e where 3>=(select count(distinct sal)
from emp where sal>e.sal) order by sal desc;

Is This Answer Correct ?    5 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

List the various privileges that a user can grant to another user?

773


What is oracle and pl sql?

827


What is the difference between clustered and non-clustered index in sql?

733


How do you respond to dementia behavior?

720


List different type of expressions with the example.

698






What do you understand by pl/sql records?

721


How does cross join work in sql?

704


What is the basic structure of an sql?

753


What are local and global variables and their differences?

806


What is row_number () in sql?

726


How to create your own reports in sql developer?

729


What are reports usually used for?

759


what is the difference between clustered and non clustered index in sql? : Sql dba

737


Can one improve the performance of sql*loader? : aql loader

773


what is the difference between ereg_replace() and eregi_replace()? : Sql dba

763