Re: Does Codd's view of a relational database differ from that ofDate& Darwin? [M.Gittens]

From: Alfredo Novoa <alfredo_novoa_at_hotmail.com>
Date: Tue, 07 Jun 2005 17:25:09 +0200
Message-ID: <g2fba11tarn9pb4m8m2vphljgru5bi26sr_at_4ax.com>


On Tue, 7 Jun 2005 15:07:09 +0200, Jon Heggland <heggland_at_idi.ntnu.no> wrote:

>In article <42a591c4$0$41901$ed2619ec_at_ptn-nntp-reader03.plus.net>,
>paul_at_test.com says...
>> Alfredo Novoa wrote:
>> >>Why not say then that all aggregates that involve a NULL return NULL?
>> >
>> > This is what SQL does. Sometimes we want to get a value but we get a
>> > null instead.
>>
>> Are you sure? I've just tried summing a column that contains a NULL in
>> PostgreSQL and it doesn't return NULL - it treats the NULLs as zeros.
>
>Not exactly: SQL ignores NULLs in aggregate functions (except COUNT(*)).
>It is not treated as zero for AVG, for instance. Also note that x + NULL
>evaluates to NULL; therefore, SQL's SUM is not iterated addition -- it
>has a much more complicated definition.

Thanks for the clarification.

Here is clear that SQL nulls are a complete botch-up.

Regards Received on Tue Jun 07 2005 - 17:25:09 CEST

Original text of this message