Re: HELP! Oracle Error
From: Joyce Rowe <J.E.Rowe_at_staffs.ac.uk>
Date: 1995/10/04
Message-ID: <44u15l$dji_at_bs33n.staffs.ac.uk>#1/1
Date: 1995/10/04
Message-ID: <44u15l$dji_at_bs33n.staffs.ac.uk>#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
>
How about trying:
select * from sales where cost > 0.5 * quantity
although this would select any records where quantity is zero, so you might also want:
and quantity != 0; or quantity is not null if the column is empty
Joyce Received on Wed Oct 04 1995 - 00:00:00 CET