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: Order of where clause matters!

Re: Order of where clause matters!

From: Andreas Stephan <nospam.as.stedat_at_gmx.net>
Date: 2000/05/29
Message-ID: <39327D26.C684771E@gmx.net>#1/1

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

Original text of this message

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