Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: Last 100 rows

Re: Last 100 rows

From: Mat Kelcey <matthew.kelcey_at_SPAMMENOT.nokia.com>
Date: 2000/06/01
Message-ID: <3936061D.DBEA664@SPAMMENOT.nokia.com>#1/1

isn't this going to be just as slow, since the sub query is a full select also?

how do we extend this kind of query to work with not just the last rows but an arbitrary set of rows somewhere in the table?

i can understand that with a sort the entire table needs to be scanned but with a plain select * why can't i get ask for row 100 to row 200 or something (skipping row's up to 100)? this is important when i want 100 rows from 999,600 to 999,700 for example since i don't want to have to scan over the first 999,600.

when an order by clause is added things get even worse!

i just wish i could use scrolling result sets.. (but will have to wait until we have the server/driver combo to support it)

</mat>

Carsten Jacobs wrote:

> How about:
> select * from
> (select *
> from huge_tab
> order by order_col DESC)
> where rownum < 101;
>
> Carsten
>
> sang schrieb:
> >
> > Hi ,all
> >
> > I want to get my last 100 rows data from my huge table ordered by date.
> > and i want to get the last row too.
> > I know i can Select * from hugetable and move to the last, but it will take
> > much
> > time for it.
> >
> > Has anyone a quick way?
> >
> > Thanks in advance
>
> --
>
> The information transmitted is intended only for the person or entity to
> which it is addressed and may contain confidential and/or privileged
> material. Any review, retransmission, dissemination or other use of, or
> taking of any action in reliance upon, this information by persons or
> entities other than the intended recipient is
> prohibited. If you received this in error, please contact the sender and
> delete the material from any computer.
Received on Thu Jun 01 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US