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

Home -> Community -> Usenet -> c.d.o.server -> Re: Sorting Oracle tables

Re: Sorting Oracle tables

From: Rich Woods <rawoods_at_concentric.net>
Date: 1997/08/31
Message-ID: <340A2708.9D3F51A3@concentric.net>#1/1

Carlos García wrote:

> Hi
>
> Can anyone tell me how to resolve this problem?
>
> I use VB5 and ODBC to access to an Oracle DB under Windows NT Server.
>
> I have a table with a column called product_id. This column is used
> for
> identify the products in my app.
> Well, i need to access to one row using a select.... where product_id
> =
> 1111, and i need to movenext and moveprevious over this table, in
> order to
> obtain the next an previous product row ordered bye product_id.
> I can make this using "order by product_id", but the query is too
> slow.
> if i don't use the "order by product_id" clause, the rows are not
> sorted in
> my query.
> Can i make this table sorted bye product_id, and obtain the rows
> ordered by
> product_id when i call movenext and moveprevious method?
> In this case, i not need to use the "order by product_id" clause and i
> gain
> much speed in query. In the same way, how to, when i add a row, this
> row is
> added in the sorted position?
> please, e-mail me at cgg_at_lcg.servicom.es
> thanks very much
> regards
> cgg '97

Why not create a unique index on product_id that your eqi-join and order by can utilize?

--
Rich Woods
Technical Field Support Specialist, Oracle Corporation, USA
The above statements and opinions are my own and do not
necessarily represent those of Oracle Corporation.
Received on Sun Aug 31 1997 - 00:00:00 CDT

Original text of this message

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