Re: Examples of SQL anomalies?

From: Marshall <>
Date: Thu, 3 Jul 2008 07:48:15 -0700 (PDT)
Message-ID: <>

On Jul 3, 7:19 am, Bob Badour <> wrote:
> David Cressey wrote:
> >>MIN, MAX and AVG are meaningless when applied to an empty bag, but it seems
> Bullshit! The identity element for min is the largest representable
> value. The identity element for max is the smallest representable element.

I don't entirely agree.

Certainly for mathematical integers, there is no largest representable element. In more practical terms, one can imagine an "arbitrary" precision integer, which starts with a 32 bit length value followed by that many 32 bit quantities of bits. Although one *could*, on attempting to evaluation MIN of an empty set/bag, return the smallest representable number, it's not clear that allocating the 16 gigabytes of RAM that are necessary to do so is a good idea.

For fixed-size integer values, there are no implementation difficulties.
However, I'm not sure that semantically, this is entirely what we want, even though there is the very strong argument that the smallest int is the identity for the operation.

Marshall Received on Thu Jul 03 2008 - 16:48:15 CEST

Original text of this message