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: 8i vs 9i: Difference in "group by" ?

Re: 8i vs 9i: Difference in "group by" ?

From: Thomas Kyte <tkyte_at_oracle.com>
Date: 31 May 2002 13:25:54 -0700
Message-ID: <ad8m8i01nn8@drn.newsguy.com>


In article <ad8fnv$6i8$06$1_at_news.t-online.com>, Andreas says...
>
>Hi,
>
>is there some known difference in the group by directive
>between 9i and 8i?
>
>We have an application that runs well on 7.3 to 8i.
>One customer tried it on a 9i, and it seems a statement like
>
>select Decode(...about 3 lines of code...),foo
>from tblFoo
>group by Decode(...about 3 lines of code...)
>
>is GROUPED by the decode statement, but not ORDERED by it.
> From our previous experiences GROUP allways caused an
>ORDER (unless overwritten with an explizit ORDER BY) - is
>this "unofficial" behaviour, or is the missing ordering
>a bug?
>

group by NEVER had to sort -- I can give you examples all of the way back to 7.0 whereby the group by doesn't sort.

It never had it.
It never was assured.

The *only* way -- repeat -- the ONLY way to get an ordered result set is .... to use ORDER BY.

Here is a really old posting from 1998 where we had an interesting discussion on this very topic:

http://groups.google.com/groups?selm=36841a07.21358221%40192.86.155.100&output=gplain

the entire thread is:

http://groups.google.com/groups?hl=en&lr=&threadm=36841a07.21358221%40192.86.155.100&rnum=2&prev=/groups%3Fq%3Dkeystroke%2Bkyte%2Bgroup%2Bby%2Border%2Bgroup:comp.databases.oracle.*%26hl%3Den%26lr%3D%26selm%3D36841a07.21358221%2540192.86.155.100%26rnum%3D2

....

>(well, we will probably use that chance to clean up
>that code a bit, using a view instead...)
>
>--
> Andreas
>if ((sex==fem)&&(hobby==comp)&&(age~25)&&(status==single)
>&&(cntry=GER)) goto http://www.kochandreas.com/home/single.htm
>

--
Thomas Kyte (tkyte@oracle.com)             http://asktom.oracle.com/ 
Expert one on one Oracle, programming techniques and solutions for Oracle.
http://www.amazon.com/exec/obidos/ASIN/1861004826/  
Opinions are mine and do not necessarily reflect those of Oracle Corp 
Received on Fri May 31 2002 - 15:25:54 CDT

Original text of this message

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