Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: group by clause ordering

Re: group by clause ordering

From: Thorsten Kettner <thorsten.kettner_at_web.de>
Date: 26 Apr 2007 23:12:18 -0700
Message-ID: <1177654337.877293.43790@b40g2000prd.googlegroups.com>


On 26 Apr., 16:31, DA Morgan <damor..._at_psoug.org> wrote:
> mariegriffiths wrote:
> > Is there any way in which
> > select <blar>
> > from <blar>
> > group by a,b
>
> > would not give the same results as same query with the columns in the
> > group by clause changed
>
> > select <blar>
> > from <blar>
> > group by b,a
>
> > Ignoring ordering.
> > I am thinking about null columns, duplicate rows min max, count
> > functions here.
>
> <blar>?
>
> Write real SQL and perhaps we can help you.
> --
> Daniel A. Morgan

I don't agree. Marie is asking if it is possible to get other result rows only by changing the order of a group by clause, so she puts in <blar> to show that it can be anything. Use your imagination. Is there any case you can think of that only the change of order in group by leads to other result rows?

Marie, no, it is not possible to get other resulting rows by only changing the group by order. You get the same groupings, no matter if you group by a first and then by b or vice versa. And as all aggregation (min, max, count, ...) is done per group, you definitely get the same result rows. Received on Fri Apr 27 2007 - 01:12:18 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US