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

From: mountain man <hobbit_at_southern_seaweed.com.op>
Date: Fri, 10 Jun 2005 01:00:16 GMT
Message-ID: <AC5qe.11727$F7.5746_at_news-server.bigpond.net.au>


"Jon Heggland" <heggland_at_idi.ntnu.no> wrote in message news:MPG.1d12119bc749ea5198968a_at_news.ntnu.no...
> In article <P0tpe.7445$F7.5240_at_news-server.bigpond.net.au>,
> hobbit_at_southern_seaweed.com.op says...
>> >>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.
>>
>> On the contrary, the answer is wrong for the MS TSQL.
>> The AVG and SUM commands ignore nulls - they are
>> not treated as *anything*, which in fact, they're not.
>
> Isn't that what I said? "SQL ignores NULLs in aggregate functions
> (except COUNT(*))."

Yes, the first part of what you said was correct. My apologies for the confusion on the first part.

>> And x + NULL does not evaluate to NULL but x.
>
> I should have mentioned that I am talking about the SQL2 standard (or
> SQL/92 or SQL:1992 or SQL-92 or whatever it is called). I am not
> familiar with MS TSQL.

It appears to be an ISO/ANSI SQL standard. SQL-99:

http://groups.google.com.au/group/comp.databases.theory/msg/0734fcfae6480291?hl=en

-- 
Pete Brown
Falls Creek
OZ
www.mountainman.com.au
Received on Fri Jun 10 2005 - 03:00:16 CEST

Original text of this message