How do I limit the number of rows returned by an Oracle query after ordering?
You can use a subquery for this like select * from ( select * from emp order by sal desc ) where ROWNUM <= 5; Have also a look at the topic On ROWNUM and limiting results at Oracle/AskTom for more information. Update: To limit the result with both lower and upper bounds things get … Read more