I'm creating a SQL query with Oracle 10g, and the output should look like this:
----------------------------------------------------------------------------------
TEXT VALUE1 VALUE2 VALUE3 VALUE4
---------------------------------------------------------------------------------
TEXT1 8795 5684 value1-value2 value3/value2*100
TEXT2 235 568 ... ...
TEXT3 125 23 ... ...
TEXT4 789 58 ... ...
TEXTN 0 0 ... ...
When I try to calculate VALUE4 column I get this error :
ORA-01476: le diviseur est égal à zéro
01476. 00000 - "divisor is equal to zero"
*Cause:
*Action:
The same error persists despite my attempts to use the DECODE function and the CASE function.
NB: The calculated columns VALUE1, VALUE2, VALUE3, and VALUE4 are: VALUE1 = sum(col1)+sum(col2); and similarly for the other VALUE2 column.
Can someone please help me with this?