I guess it wouldn't hurt to include Mr. Kyte's answer:
select * 
  from ( select a.*, rownum rnum
           from ( YOUR_QUERY_GOES_HERE -- including the order by ) a
          where rownum <= MAX_ROWS )
 where rnum >= MIN_ROWS
/

He demonstrates on the site why this is the best solution.

> -----Original Message-----
> From: Jacques Kilchoer 
> 
> Tom Kyte to the rescue!
> getting rows N through M of a result set
> http://asktom.oracle.com/pls/ask/f?p=4950:8:::NO::F4950_P8_DIS
PLAYID,F4950_P8_CRITERIA:127412348064,
or
http://tinyurl.com/hqsl

(You can ignore the little argument on that page where Mr. Kyte lays down the law 
about not using abbreviations like "u r" for "you are".)


-----Original Message-----

CASE 

select * from table gives  1000 records (say) 
We want only first ten of these records to be returned to the front end 
& then records 11 to 20 & so on ...

How may the above be optimally possible ? 
SQL or PL/SQL any for it ?
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Jacques Kilchoer
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to