
On Tue, 11 Dec 2007, Anthony Clayden wrote:
I agree with Henning that HAVING is a 'terrible hack', but then SQL altogether is a terrible hack.
Somehow, yes.
As that paper points out, HAVING is unnecessary - it's just a filter on the result set of group-by.
Yep.
It's crucial that in Relational Algebra everything is a table. (See Codd's 12 rules). The result of GROUP BY we might want to pass to another GROUP BY, or JOIN to another table, etc -- or does Henning propose a hierarchy of sets of sets ...
Yes, why not? Works fine in Haskell. Ok, Haskell programs do not construct different query processing strategies and compare them at run-time, so the comparison between Haskell compilers and databases is not quite fair.
of tables, presumably with a hierarchy of HAVINGHAVING's?
map (map (map (filter p))) and so on :-)