Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Help on expression compare in Oracle
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
![]() |
![]() |