Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Order of where clause matters!
You won't get the error, but you would get rows where col_a = 0 but you don't want them.
two safe ways to do it:
Select * from my_table
where decode (col_a, 0, 0, col_b / col_a) > 10 ;
or
(maybe slower 'cause it uses a subquery)
select *
from
(
Select * from my_table where col_a <> 0
>
>A workaround could be:
>
>select *
>from my_table
>where stuff /* stuff that means "col_a" is never 0 */
>and col_b/decode(col_a, 0, 1, col_a) > 10;
>
>So you won't get the error.
>
>Wei
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.
Received on Fri May 26 2000 - 00:00:00 CDT