Re: The job of a relational DBMS

From: Mark D Powell <>
Date: Fri, 4 Dec 2009 07:08:02 -0800 (PST)
Message-ID: <>

On Dec 1, 5:44 pm, Thomas Kellerer <> wrote:
> Gene Wirchenko wrote on 01.12.2009 05:35:
> >      For example, a group by in SQL forces the result to be sorted by
> > the grouping unless otherwise overridden.
> Never has been true. Group by does *not* sort the result.
> Not even in Oracle 8 and and certainly not for any Oracle version > 9
> (and not for any Postgres as well)
> Thomas

Even back on version 7.x we experienced a group by query not returning the result set rows in the same order as the group by expression. Technically since at least the version 7 manuals the order by has always been requried to ensure the order of the data returned. The reality before 10g is that most statements using group by would return the data in the group by order; however, with 10g and the hash group by plan feature, the odds of the data not always returning in the group by expression order have gone way up. I would suggest that whenever the order that the result set is returned/displayed in is important that the order by claude be made a manditory coding practice.

HTH -- Mark D Powell -- Received on Fri Dec 04 2009 - 09:08:02 CST

Original text of this message