Re: Examples of SQL anomalies?
Date: Tue, 1 Jul 2008 09:20:20 -0700 (PDT)
Message-ID: <2967b92f-b3a2-4b70-b264-246c82eaaaa4_at_k13g2000hse.googlegroups.com>
Not quite the same thing ..
>> We can add up all the numbers in it and get a total; that total is zero. <<
But there are no members to add! You created zero from nothing as a convention to get rid of the term in the sequence. In the older summation notation, there also is a convention that when the initial value of the index is greater than the final value, the summation is zero. Pardon my pseudo-code, but how do you defend the traditional approach which says:
SUM (i) FOR i FROM 7 TO 9 = 24
SUM (i) FOR i FROM 9 TO 7 = 0
A set-oriented version might be:
I can support this convention with associativity, commutativity and
SUM (i) FOR i IN {7,8,9} = 24
SUM (i) FOR i IN {9,7,8} = 24
SUM (i) FOR i IN {8,9,7} = 24
SUM (i) FOR i IN {9,8,7} = 24
etc.