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 -> How do I view a block of n rows anywhere in the table?

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

From: Steven Franklin <steven.franklin_at_wcom.com>
Date: Thu, 03 Jun 1999 13:58:10 GMT
Message-ID: <37568A1A.A52F62C6@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 Thu Jun 03 1999 - 08:58:10 CDT

Original text of this message

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