2015-10-28 11:26 GMT+01:00 Rami Ojares <[email protected]>:

> Ok, now I think I got it.
> GROUP BY () groups all the rows into one group (although logically they
> were one group already)
> but this is needed if one wants to use aggregate operators in the
> restriction of rows.
> And now that all the rows are in a group we can use the having clause to
> filter that group.
>

Yes


> Thank you for clarifications, Lukas.
>
> Cube, rollup and grouping sets do not seem to me very useful shorthands.
> Do you have examples of why they would be useful?


Why not? How else would you aggregate revenue over several dimensions?

- Total revenue, revenue per business unit, revenue per sales employee:
ROLLUP
- Total revenue, revenue per business unit, revenue per country, revenue
per country and business unit: CUBE

The same can be achieved with lots of UNION ALL repetition, as explained in
that SQL Server page.

Cheers
Lukas

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to