Re: SUM and NULL values
Posted in 1997
Akis Xenophontos wrote: > > E-mail Address: akisx@logica.com > Name: Akis Xenophontos > Company: Logica UK Ltd > Postal Address: London NW1 > Tel No: 0044171 446 1324 > > Date: 16/06/97 > > I have the following problem: > > select sum(a) + sum(b) + sum(c) > from table_a > > returns null if columns values b are all null for example. > > Is there a way, within one SQL statement, to treat the NULL as a > 0 and return the aggregate sum of columns a,b and c? The CREATE TABLE statement allows you to specify default values for individual columns. If you insert a row without specifying values for those columns, they are assigned the default value. This is according to the manual - I haven't tried it. ----------- Roger Tomas AG Communication Systems