Re: GROUP BY

From: V.J. Kumar <vjkmail_at_gmail.com>
Date: Mon, 21 May 2007 02:55:20 +0200 (CEST)
Message-ID: <Xns9936D5025CC93vdghher_at_194.177.96.26>


"V.J. Kumar" <vjkmail_at_gmail.com> wrote in news:Xns9936C58B97D81vdghher_at_194.177.96.26:

> 

>>I'm curios cause DB2 returns 1 row, and
> 
> Apparently,  the IBM folks need to read the standard !
> 

>> apparently others return 0 rows. I can imagine both definitions, and
>> would like to check out what the standard actually says.

Actually, after rereading the standard I think I was unfair towards 'the IBM folks'. Whether or not 'select 1 from T group by ()' should return one or zero rows, depends on whether or not an empty set can be partitioned, which in its turn depends on axioms set partitioning should satisfy. If you accept, as the formal set theory does, that an empty set can be (the only possible) partition of itself, then returning one row with the above query is OK. Since the 2003 standard is silent on this point, implementations returning either one or zero rows are both 'right'!

>>
>>
>> Thanks
>> /Lennart
>>
>>
>> [...]
>>

>
> Received on Mon May 21 2007 - 02:55:20 CEST

Original text of this message