Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Retrieve N record from a large table...
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
![]() |
![]() |