Re: Examples of SQL anomalies?

From: Bob Badour <bbadour_at_pei.sympatico.ca>
Date: Mon, 30 Jun 2008 20:07:33 -0300
Message-ID: <48696737$0$4061$9a566e8b@news.aliant.net>


Marshall wrote:

> On Jun 30, 10:31 am, "Brian Selzer" <br..._at_selzer-software.com> 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 Mon Jun 30 2008 - 18:07:33 CDT

Original text of this message