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 & implicit sorts

Re: GROUP BY & implicit sorts

From: Niall Litchfield <n-litchfield_at_audit-commission.gov.uk>
Date: Wed, 24 Jul 2002 09:30:58 +0100
Message-ID: <3d3e65c3$0$234$ed9e5944@reading.news.pipex.net>


"Charlie Edwards" <Charlie3101_at_hotmail.com> wrote in message news:db479d88.0207240019.54e7b6f9_at_posting.google.com...
> This is just an academic question.

Oh no it isn't
>
> Recently I read somewhere that Oracle does not guarantee that a GROUP
> BY will always sort the result set (as if you did an ORDER BY).
>
> Now I always assumed that this was the case (probably just because in
> my experience this always seemed to happen).
>
> Is Oracle just covering itself here? Along the lines of "we never
> actually promised that GROUP BY will do a sort, so if we find a better
> way of grouping without sorting, don't blame us".
>
> Has anyone ever had experience of a GROUP BY that didn't sort as
> expected?
>
> I've left code with a GROUP BY but no ORDER BY in applications the
> length and breadth of England - hope my name isn't at the top ;-)

See

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&selm=36886d96.28433695%40 192.86.155.100&rnum=7

for an example of group by not being the same as order by. Indexes and parallel query may well screw up your assumption. .

--
Niall Litchfield
Oracle DBA
Audit Commission UK
*****************************************
Please include version and platform
and SQL where applicable
It makes life easier and increases the
likelihood of a good answer

******************************************
Received on Wed Jul 24 2002 - 03:30:58 CDT

Original text of this message

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