Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: group by and sorting
Eugene wrote:
> Hi all,
> Is there a way to "tell" Oracle not to sort when it's doing GROUP BY? I
> think I saw something like ... group by nosort somewhere.
>
> Eugene
Oracle doesn't 'sort' by default with group by, and such is noted in the documentation:
"The GROUP BY clause groups rows but does not guarantee the order of the result set. To order the groupings, use the ORDER BY clause."
If the operation doesn't sort there is no need for a 'nosort' option, which is invalid syntax:
SQL> select deptno, count(*) from emp group by deptno nosort; select deptno, count(*) from emp group by deptno nosort
*ERROR at line 1:
SQL> I cannot imagine where you might have 'seen' such syntax; certainly not with respect to Oracle. And, according to your post, neither do you.
David Fitzjarrell Received on Tue May 31 2005 - 16:26:08 CDT