Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Oracle 8.1.7 sort order

Re: Oracle 8.1.7 sort order

From: Tom Best <oracle_person_at_yahoo.com>
Date: Tue, 6 Aug 2002 09:03:45 -0400
Message-ID: <aiodpe$pnl$1@news.bentley.com>


Jukka:

If you do not have an "order by" clause on a query, then the order returned by Oracle is arbitrary. You may see patterns, per chance, or because of the order they were inserted, but that is nothing to count on, because, without the "order by" clause, there is no garrenteed order, so don't count on it.

HTH,
Tom Best

"Jukka Peltonen" <jukka.peltonen_at_helsoft.fi> wrote in message news:1028632504.672626_at_ns2...
> Hello, I hope someone can explain this to me ....
>
> Enviroment: Oracle 8.1.7, W2K, client 8.1.6 (oci.dll version)
>
> Table: NIMIKE
> Column:NIMIKEKOODI VARCHAR2 (40) NOT NULL
>
> I get different results from following two SQL-clauses
>
> 1st clause:
> select nimikekoodi from nimike where nimikekoodi < 'N50295X350'
>
> Result: Rows that starts with numbers and "normal strings" that are
smaller
> than 'N50295X350'
>
> Data:
> (EI)PAL495X703
> // KALV 80
> // VSK-MPE
> 001271X495
> ....
> N50295X278
>
> I think this is correct result.
>
> 2nd clause:
> select nimikekoodi from nimike order by nimikekoodi
>
> Result: All rows, but order is funny (at least I think so) because now
those
> rows that starts with numbers are now after
> row 'N50295X350'
>
> Data:
> '// KALV 80'
> ....
> 'N50295X350'
> ....
> 9,964VKI
>
> I think this is NOT a correct result.
>
> What am I doing wrong?
>
> I think that there is something wrong because field nimikekoodi values are
> handled differently
> depending on if it is in where- or order part of SQL-clause
>
>
Received on Tue Aug 06 2002 - 08:03:45 CDT

Original text of this message

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