Subject | RE: [firebird-support] NULLS in VIEW when adding values |
---|---|
Author | Helen Borrie |
Post date | 2006-03-11T10:44:11Z |
At 08:43 PM 11/03/2006, Nick Upson wrote:
eliminates any rows that have Nr1 or Nr2 null.
If I understand the question, this will do the job just fine:
select Nr1, Nr2, coalesce(Nr1, 0) + coalesce(Nr2, 0) as NrTotal from ATable
>select Nr1, Nr2, coalesce(Nr1, 0) + coalesce(Nr2, 0) as NrTotal from ATableThe WHERE clause is not needed nor justified here, since it
>where Nr1 >= 0 and Nr2 >= 0
eliminates any rows that have Nr1 or Nr2 null.
If I understand the question, this will do the job just fine:
select Nr1, Nr2, coalesce(Nr1, 0) + coalesce(Nr2, 0) as NrTotal from ATable