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: Jukka Peltonen <jukka.peltonen_at_helsoft.fi>
Date: Wed, 07 Aug 2002 07:56:04 GMT
Message-ID: <1028706964.47888@ns2>


Thanks for your reply,

Actually in 1st clause order has no meaning, important is that rows that starts
with numbers are included = they are smaller than 'N50295X350'

In 2nd clause oracle claims that rows that starts with numbers are bigger than 'N50295X350'

And this is the problem.

I solved it with NLS_SORT

"Tom Best" <oracle_person_at_yahoo.com> wrote in message news:aiodpe$pnl$1_at_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 Wed Aug 07 2002 - 02:56:04 CDT

Original text of this message

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