Addition with NULL values

后端 未结 5 815
傲寒
傲寒 2020-12-10 11:00

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

5条回答
  •  青春惊慌失措
    2020-12-10 11:30

    I accomplished it this way:

    coalesce("Column1",0.00) + coalesce("Column2",0.00)
    

    I'm working with front end high level execs.... They don't understand why NULL and 0 aren't handled the same way.

    In my case it works, just replacing NULLs with 0.00... may not in all though :)

提交回复
热议问题