# Re: Examples of SQL anomalies?

Date: Fri, 27 Jun 2008 14:29:20 -0700

Message-ID: <vqma641l1rqql3uhtllme0mqohbheqmruc_at_4ax.com>

-CELKO- <jcelko212_at_earthlink.net> wrote:

>>> The question is, if these issues are due to the SQL specification or simply due to a problem in a specific SQL product. Or could it be, that the definition is not precise enough in some points, so that database vendors implemented it differently? <<

*>
**>Nope, it is the specs. All aggregate (set) functions begin by
**>removing the NULLs from their parameter set, then if there is a
**>DISTINCT option on the parameter, they remove redundant duplicates and
**>finally do the operation (MIN, MAX, AVG, SUM, COUNT on what is left.
**>Since an empty set has no elements upon which to apply an operation,
**>SQL returns a NULL (okay, it should be an "undefined" if we were
**>mathematically correct).
*

No, it should be zero per mathematicians I have checked with.

>In SQL as in Set Theory, equality (=) and grouping are not the same;

*>the SUM() and the + are not the same. They are for different levels
**>of abstraction. It makes senses after your first course with
**>transfinite numbers -- the cardinality of Aleph Null is not the same
**>as counting all the integers one by one, etc.
*

Bafflegab. I have studied transfinite numbers; the area is irrelevant.

Sincerely,

Gene Wirchenko

Computerese Irregular Verb Conjugation:

I have preferences. You have biases. He/She has prejudices.Received on Fri Jun 27 2008 - 23:29:20 CEST