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

How would you convert date into julian date format?

590


Which data dictionary views have the information on the triggers that are available in the database?

752


What does <> sql mean?

535


What is execute immediate?

549


Can we rename a column in the output of sql query?

538






How to set up sql*plus output format in oracle?

593


What is rownum and rowid?

565


Does oracle roll back the transaction on an error?

529


What is the command used to fetch first 5 characters of the string?

878


Is inner join faster than left join?

629


what are sequences

1090


What is trigger price?

538


What is a table in a database?

575


What is union?

650


If i can use sys.check_constraints to display my constraints from my database using sql server 2005, how can i display then if i am using sql server 2000????

3546