Re: HAVING vs. FILTER

On 13 Nov 2009, at 11:53, Andy Seaborne wrote:
> On 13/11/2009 07:18, Axel Polleres wrote:
>> One concern raised was IIRC why we need both if HAVING is anyway  
>> redundant by:
>>
>> SELECT AGG(?X)
>> WHERE P
>> GROUP BY G
>> HAVING R
>>
>>  being equivalent to
>>
>> { SELECT AGG(?X)
>> WHERE P
>> GROUP BY G }
>> FILTER R
>
> Can R be (count(*)>0) ?

That's a good point, but the {}s aren't strictly necessary:

SELECT AGG(?X)
WHERE P
GROUP BY G
FILTER R

is still unambiguous, as a scalar FILTER would be illegal there, but  
it makes me much less keen on using one keyword.

Consider that a +0.5 to HAVING, -0.5 to FILTER. I still don't care  
that much :)

- Steve

-- 
Steve Harris, CTO, Garlik Limited
2 Sheen Road, Richmond, TW9 1AE, UK
+44(0)20 8973 2465  http://www.garlik.com/
Registered in England and Wales 535 7233 VAT # 849 0517 11
Registered office: Thames House, Portsmouth Road, Esher, Surrey, KT10  
9AD

Received on Friday, 13 November 2009 15:54:20 UTC