jammy-d0dger
asked on
How to add 2 decimal columns when one of them may be null
Hi experts,
If I have two decimal columns in a table and I want to return the sum of the two columns added together as another column in my resultset, how do I do it when one of the columns 'may' be NULL?
(OPR.refund_product_value + OPR.refund_extra_value) AS refund_total_value
If one of the two values here is NULL, the result is also NULL.
Help appreciated.
If I have two decimal columns in a table and I want to return the sum of the two columns added together as another column in my resultset, how do I do it when one of the columns 'may' be NULL?
(OPR.refund_product_value + OPR.refund_extra_value) AS refund_total_value
If one of the two values here is NULL, the result is also NULL.
Help appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect, spot on. Works a treat, thanks for that.
FROM table1