Re: Examples of SQL anomalies?

From: Bob Badour <>
Date: Mon, 30 Jun 2008 20:07:33 -0300
Message-ID: <48696737$0$4061$>

[Quoted] Marshall wrote:

> On Jun 30, 10:31 am, "Brian Selzer" <> wrote:

>>Well, the OP wanted examples of SQL anomalies, and you've just confirmed a
>>big one.
>>If you have a bag that can contain peaches, but doesn't, then the answer to
>>the question "How many peaches are in the bag?" is clearly zero. If you are
>>asked by the accountant, "How much were we billed by AT&T this month?" but
>>AT&T didn't send a bill, then the answer is clearly zero. That SQL's COUNT
>>and SUM are something other than these common sense usages exemplifies their
>>anomalous nature.
> [I meant to say this in my other post, but]
> Brian gets it exactly right here.
> Marshall

Well, except that SQL adds the additional anomaly that count(*) != sum(1)

ie. SQL can count zero rows with count but not with sum. Received on Tue Jul 01 2008 - 01:07:33 CEST

Original text of this message