Re: does a table always need a PK?
Date: Tue, 02 Sep 2003 17:49:35 GMT
Message-ID: <PK45b.255380$Oz4.67583_at_rwcrnsc54>
"Lee Fesperman" <firstsql_at_ix.netcom.com> wrote in message news:3F5452A0.1AB_at_ix.netcom.com...
>
> ... because the SUM() function and the '+' operator, while similar, are different
> operations.
Yuck. Sum() should be nothing more than the reduction of + over the attribute. Anything else is an unnecessary complication.
> SUM() throws away any NULL results and only sums non-NULL values. The +
> operator yields NULL if either operand is NULL.
I don't see how this can be considered valid. (I *can* see how it could be the SQL standard, but that's another story.) If null specifies missing data, then sum() over an attribute where the attribute value is null in any tuple is necessarily null.
Under the logic you describe, we have two different kinds of addition where one suffices.
I am no fan of null, but even if we accept the idea of null, isn't it possible to get whatever behavior we need by an appropriate use of CASE or WHERE NOT NULL or some such?
Marshall