Re: HELP! Oracle Error

From: Louise Miller <miller_at_louise.ucsd.edu>
Date: 1995/09/29
Message-ID: <1995Sep29.221039.21867_at_nosc.mil>#1/1


Jee Myeong Ku <jku> wrote:
>I get an oracle divide by zero error when I type the following SQL command:
>
>select * from sales where cost / quantity > 0.5
>
>The reason is that there is at least one row in the sales table where
>the value of the field quantity is 0.
>
>Does anyone know a way to get around this problem without using views
>or nested queries?
>
>Jee Ku
>

Is there some reason you don't want to say select * from sales where (quantity != 0) and (cost/quantity > 0.5)

Louise Miller Received on Fri Sep 29 1995 - 00:00:00 CET

Original text of this message