Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Indexes in Oracle 8i?
On Wed, 17 Oct 2001 08:28:02 GMT, "Raheen Ballard"
<rballard34_at_home.com> wrote:
> Hi! I'm using Oracle 8i personal edition and I was trying out some of the
>Index exercises in my book (Sam's), but my results don't seem to be correct.
>For instance, I input:
>
>
>create index ID_INDEX on bills( ACCOUNT_ID );
>========
>and i get back:
>
>NAME AMOUNT ACCOUNT_ID
>------------------------------ ---------- ----------
>PHONE COMPANY 125 1
>POWER COMPANY 75 1
>RECORD CLUB 25 2
>SOFTWARE COMPANY 250 1
>CABLE TV COMPANY 35 3
>JOE'S CAR PALACE 350 5
>S.C. STUDENT LOAN 200 6
>FLORIDA WATER COMPANY 20 1
>U-O-US INSURANCE 125 5
>DEBTOR'S CREDIT CARD 35 4
>
>Index created.
>=====================
>
> It tells me that the index was created, but the results are the same as
>if I'd never created the index...am I doing something
>wrong? I've tried it on several other tables, with same results...
>
>Thx!!!
Without the actual sql statement this is a bit difficult to answer,
but I assume you created the index and now expect the results
automatically to be ordered by the index.
By design the result returned is a *set* and sets are by design and
convention *unordered*
You either need to use an explicit order by
or a trick dummy where clause
(account_id > 0)
Hth
Sybrand Bakker, Senior Oracle DBA Received on Wed Oct 17 2001 - 03:52:11 CDT
![]() |
![]() |