Explore Courses Blog Tutorials Interview Questions
0 votes
in SQL by (2.5k points)

In a stored procedure (Oracle in my case), I want to add some values to an existing record. Problem is that both the existing value and the value to be added can be null. I only want the result to be NULL when both operands are null. If only one of them is null, I want the result to be the other operand. If both are non-null, I want the result to be "normal" addition.

1 Answer

0 votes
by (7.2k points)

You can use ISNULL for adding some null value, 

, so if you have 5 values



 We have to use 0, where we get NULL value in it. otherwise its original value in SQL server.

Browse Categories