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

Home -> Community -> Usenet -> c.d.o.misc -> Re: How do I view a block of n rows anywhere in the table?

Re: How do I view a block of n rows anywhere in the table?

From: Philippe <parnaud_at_yahoo.com>
Date: Fri, 4 Jun 1999 13:00:10 +0200
Message-ID: <7j8bk7$3np$1@concorde.ctp.com>


try this :

SELECT X.KEY1, X.KEY2, X.COL1, X.COL2 FROM (SELECT /*+ RULE */ TBL.* , ROWNUM ROWCOUNT FROM TBL , DUAL D WHERE TBL.KEY2 = D.DUMMY (+)) X
WHERE X.ROWCOUNT BETWEEN LowerRow AND UpperRow

HTH Philippe

Steven Franklin wrote in message <37568A1A.A52F62C6_at_wcom.com>...
>I'm trying to look at block of n rows anywhere within the table. i.e.
>I don't want to format 250K rows for display in HTML. Rather, I'd like
>to be able to format and display a block of say 10 rows at a time and
>skip around through the table.
>
>This method seems to work, but it gets very slow when trying to
>look at rows further into the table.
>
>SELECT driver.key1,
> driver.key2,
> col1,
> col2
>FROM tbl,
> (SELECT /*+ INDEX(tbl idx_key2) */
> rownum rn,
> key1,
> key2
> FROM tbl
> WHERE rownum <= UpperRow) driver
>WHERE (tbl.key1=driver.key1) AND
> (tbl.key2=driver.key2) AND
> (rn >= LowerRow)
>
>where idx_key2 is an index with the desired sort order. And UpperRow and
>LowerRow define the boundries of the block want to look see.
>
Received on Fri Jun 04 1999 - 06:00:10 CDT

Original text of this message

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