Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Group By Questions..
Jimmy wrote:
>
> Hello all,
>
> Assume I have a table with column A, B, C and D.
>
> I wonder the following SQL statements will produce the same results:
>
> i) select B, C, D, avg(A) from AAA group by B, C, D;
> ii) select B, C, D, avg(A) from AAA group by B, D, C;
> iii) select B, C, D, avg(A) from AAA group by C, B, D;
> ....
>
> i.e. does the order of group by clause affect the final result (or
> performance, if any) of the SQL statement? Anyone knows white papers or
> documents discussing this issue?
>
> Thanks,
> Jimmy
The result in terms of data will not be different...but it is possible that you will get the rows back in a different order (this would be negated by also specifying an order-by clause).
Performance would be dependent on two things:
Cheers
Connor
Received on Sat Oct 02 1999 - 04:48:17 CDT
![]() |
![]() |