[Haskell-cafe] Re: group-by (Was: Nested guards?)

Henning Thielemann lemming at henning-thielemann.de
Tue Dec 11 02:03:21 EST 2007

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.


> 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 :-)

More information about the Haskell-Cafe mailing list