In DB2 sql syntax
how to do the function below?
SELECT Qcode, iif( sum(A)>= sum(B), 0, SUM(B) - SUM(A)) AS QTy
FROM [...] group by Qcode
in other world, how to do the same of IIF function seen that it doesn't exist in db2?
Or is there a function which return number 'A' if it is positive
and Zero if it is negative?