Re: [HACKERS] SUM() and GROUP BY

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] SUM() and GROUP BY
Дата
Msg-id 199901131743.MAA16352@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] SUM() and GROUP BY  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
> I disagree ... the sum of zero items has traditionally been defined as
> zero by any mathematician you care to ask.  No logical problems are
> introduced by doing so, and it avoids an unpleasant special case that
> applications would otherwise be forced to deal with.  (Example: if
> D'Arcy's tramount column has been declared NOT NULL, then it seems to me
> that his code is entitled to expect to get a non-NULL result from SUM().
> He should not have to cope with a NULL just because the table is empty.)

Informix returns NULL for sum.  It returns a zero only for count().


--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Brook Milligan
Дата:
Сообщение: references to packaged versions of PostgreSQL
Следующее
От: Hal Snyder
Дата:
Сообщение: Re: [HACKERS] references to packaged versions of PostgreSQL