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 -> Retrieve N record from a large table...

Retrieve N record from a large table...

From: Jimmy <c6635500_at_comp.polyu.edu.hk>
Date: Thu, 02 Sep 1999 00:18:38 -0700
Message-ID: <37CE24CE.7549CD0A@comp.polyu.edu.hk>


Hello all,

    I have a table AAA with over 50000 rows. Assume the table structure of table AAA is as follows:

    a number;
    b varchar2(100);
    c varchar2(100);

    Now I want to retireve the N record of this table by using the following SQL statement in SQL*Plus:

    select whole_str from (select a || b || c whole_str, rownum rowno from AAA) where rowno = &N;

    It returns a string with A + B + C with record number N in table AAA. However, the time to do this query, as I expected, takes so long to run.

    (in fact, in my case, the table AAA may have over 30 columns)

    How can I rewrite this SQL statement such that it can improve the query time? Can I get the same results by using rowid? (I think using rowid is the fastest way)

Thanks,
Jimmy Received on Thu Sep 02 1999 - 02:18:38 CDT

Original text of this message

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