Wednesday, March 29, 2006

get the top n rowns from M rows of a Resultset

select *
from ( select a.*, rownum rnum
from ( YOUR_QUERY_GOES_HERE -- including the order by ) a
where rownum <= MAX_ROWS ) where rnum >= MIN_ROWS

0 comments: