Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Pull records 1000-2000 from SQL recordset
Mike Philippens schrieb:
> Scott Cooper wrote:
> > I have a query that is pulling 5000 records back from Oracle, but I may
> > only be interested in records 1000-2000 at the moment (may want to work
> > with any subset, just using this as an example). I have an order by
> > clause in the query, and I want the 1000-2000 recordset to be taken
> > AFTER the sort. Can I achieve this in SQL, or do I have to process the
> > recordset outside of SQL?
>
Try the following:
select rownum, sub.*
from
(
select rownum sub_rownum, tab.*
from <TABLE> tab
) sub
where sub.sub_rownum between 1000 and 2000
This is what you want....but does it make sense??? :o)
Regards, Stephan
--
Dipl.-Inf. (FH) Stephan Born | beusen Consulting GmbH fon: +49 30 549932-17 | Landsberger Allee 392 fax: +49 30 549932-29 | 12681 Berlin mailto:stephan.born_at_beusen.de | Germany --------------------------------------------------------------- PGP-Key verfügbar | PGP-Key available ---------------------------------------------------------------Received on Wed Nov 03 1999 - 03:56:09 CST
![]() |
![]() |