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: Help on expression compare in Oracle

Re: Help on expression compare in Oracle

From: tojo <Tojo_at_hotmail.com>
Date: Mon, 20 Jan 2003 15:54:41 +0100
Message-ID: <MPG.18962c1d34e4ea069896e6@news.t-online.de>


In article <78d0e70f.0301200528.46056881_at_posting.google.com>, roby81it_at_hotmail.com says...
> Hi to all newsgroup !!!
> Sorry for my bad english...
>
> I have a table with this values returned by Sql*Plus:
>
> SQL> select * from test order by 1;
>
> CHIAVE DESCR
> -------------------- ------------------------------
> A1 desc1
> A2 desc2
> A3 desc3
> 0100 desc4
> 0101 desc5
> 0200 desc6
>
> And I have this strange situation:
>
> SQL> select * from test where chiave < '0100';
>
> no rows selected
>
> SQL> select * from test where chiave > '0100';
>
> CHIAVE DESCR
> -------------------- ------------------------------
> A1 desc1
> A2 desc2
> A3 desc3
> 0101 desc5
> 0200 desc6
>
> If I decide to order by CHIAVE, why Oracle considers 'A1' lesser than '0100',
> but when I select values where chiave < '0100', it return no rows ???
>
> Please, help me...
>
> Bye,
> *Roby*
>

Looks like you're mixing and matching number fields and char fields. Not a good thing! If you must sort on this field, look at this:

http://www.arrowsent.com/oratip/tip24.htm

Received on Mon Jan 20 2003 - 08:54:41 CST

Original text of this message

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