Re: [HACKERS] proposal - GROUPING SETS

2008-09-16 Thread Pavel Stehule
2008/9/16 Greg Stark <[EMAIL PROTECTED]>: > On Tue, Sep 16, 2008 at 3:02 PM, Tom Lane <[EMAIL PROTECTED]> wrote: >> "Pavel Stehule" <[EMAIL PROTECTED]> writes: >>> select a, b from t group by grouping sets(a, b); >> >>> is same as: >> >>> select a, NULL from t group by a >>> union all >>> select NU

Re: [HACKERS] proposal - GROUPING SETS

2008-09-16 Thread Greg Stark
On Tue, Sep 16, 2008 at 3:02 PM, Tom Lane <[EMAIL PROTECTED]> wrote: > "Pavel Stehule" <[EMAIL PROTECTED]> writes: >> select a, b from t group by grouping sets(a, b); > >> is same as: > >> select a, NULL from t group by a >> union all >> select NULL, b from t group by b; > > Really? That seems utt

Re: [HACKERS] proposal - GROUPING SETS

2008-09-16 Thread Pavel Stehule
2008/9/16 Tom Lane <[EMAIL PROTECTED]>: > "Pavel Stehule" <[EMAIL PROTECTED]> writes: >> select a, b from t group by grouping sets(a, b); > >> is same as: > >> select a, NULL from t group by a >> union all >> select NULL, b from t group by b; > > Really? That seems utterly bizarre, not to say poin

Re: [HACKERS] proposal - GROUPING SETS

2008-09-16 Thread Tom Lane
"Pavel Stehule" <[EMAIL PROTECTED]> writes: > select a, b from t group by grouping sets(a, b); > is same as: > select a, NULL from t group by a > union all > select NULL, b from t group by b; Really? That seems utterly bizarre, not to say pointless. You sure you read the spec correctly?

[HACKERS] proposal - GROUPING SETS

2008-09-16 Thread Pavel Stehule
Hello, == Proposal - GROUPING SETS == a grouping set feature allows multiple grouping clauses in one query. Result of grouping sets is union of results each groupby clause's result. create table t(a int, b int); insert into t values(10,20); insert into t values(30,40); select a, b from t group