I need to perform the following
SQL query in
select (DISPONIBILIDADES/EFECTIVO) as DISPONIBLE from sbv where banco = 'ACTIVO (BU)'
But I get the following error:
ORA-01476: the divisor is equal to zero 01476. 00000 – "divisor is equal to zero"
EFECTIVO field has a value of 0. I know that a division by 0 gives an indeterminacy but I need that if the division is by 0, it gives me 0 as a result.
For this we can use a case to first make the division check that the value is not 0.
select CASE EFECTIVO WHEN 0 THEN 0 ELSE (DISPONIBILIDADES/EFECTIVO) END as DISPONIBLE from sbv where banco = 'ACTIVO (BU)'