How to replace '0'

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • heyitsmeok
    New Member
    • Jul 2010
    • 1

    How to replace '0'

    I'm 100% new to DB2. We have a bug in code where one returning value making total result incorrectly '0' (zero).

    Here is the statement which we are executing:

    SELECT SUM(MULTIPLY_AL T(A_QTY, B_QTY, C_QTY)) from CUST_QUANTITY;

    I believe this statement is multiplying A_QTY, B_QTY, C_QTY for each row and later adding all the rows (please correct me if I'm not).

    How do I check if C_QTY is not 0 (zero) and if it is 0, treat it as 1 so that multiplication of (A_QTY, B_QTY, C_QTY) should not become 0.

    I need to do this inside the select statement only.

    Please help.

    Thx!!
Working...