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

Explain polymorphism in pl/sql.

641


what are rollup and cube in t-sql? : Transact sql

661


How do I audit the sql sent to the server?

526


What is error ora-01000: maximum open cursors exceeded

606


Why schema is used in sql?

517






Does db2 use sql?

515


which operator is used in query for pattern matching? : Sql dba

547


Whis is not false in primary key?

977


How many columns should be in an index?

524


Does sql full backup truncate logs?

533


How do you write an index?

527


How can we optimize a sql query?

578


What is difference sql and mysql?

535


1) Synonyms 2) Co-related Subquery 3) Different Jobs in Plsql 4) Explain Plan 5) Wrap 6) Query Optimization Technique 7) Bulk Collect 8) Types of index 9) IF primary key is created then the index created ? 10) Foreign Key 11) Exception Handling 12) Difference Between Delete and Trunc 13) Procedure Overloading 14) Grant Revoke 15) Procedure Argument types. 16) Functions. 17) Joins

1156


What is oracle sql developer?

608