How to find 1st, 2nd, 3rd highest using select select
statement not using rownum

Answer Posted / madhavi

SELECT sal
FROM (SELECT sal, RANK() OVER(ORDER BY sal DESC) AS rnk
FROM emp)
WHERE rnk IN (1,2,3);

Is This Answer Correct ?    14 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the differences between char and nchar in oracle?

589


How do you bind variables in oracle?

533


What are the numeric comparison operations?

622


What is the difference between a primary key & a unique key?

579


What are the different types of database objects?

513






What is private procedure oracle?

519


How to delete multiple rows from a table in oracle?

551


Does oracle charge for java?

577


How to write a left outer join with the where clause in oracle?

619


Is oracle the best database?

509


How to get the Installed Oracle Version Information ?

610


What are the attributes of cursor?

578


How to change user password in oracle?

595


What is data type in oracle?

552


What is a cursor and what are the steps need to be taken?

588