Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Order of where clause matters!
Why donĀ“t you reorder your statement to ... and col_b > 10*col_a;
No division by zero any more.
hth
andy
Steve Haynes schrieb:
> Hi All,
>
> RE: 8.0.5.1.1 on NT4.
>
> I have a strange problem with a divide
> by zero error...
>
> select whatever
> from my_table
> where stuff /* stuff that means "col_a" is never 0 */
> and col_b/col_a > 10;
>
> This gave me a divide by zero error...
> I then changed the order of the where clauses
> so that "and col_b/col_a > 10" was first after the
> "where" keyword and the error went away.
>
> I then added an index and the error came back.
> Drop the index, error goes away.
>
> This is a new one on me. Two issues here, one
> is the order of the where clause, and one is
> the existence of the index (altering the plan).
>
> Is there a way I can predict this behaviour?
>
> I need the index but I don't need the error!
>
> Thanks,
>
> Steve
Received on Mon May 29 2000 - 00:00:00 CDT