Oracle-Sql [message #370399] |
Mon, 20 September 1999 08:09 |
Walter
Messages: 15 Registered: September 1999
|
Junior Member |
|
|
Sorting Problem with '+' and '-'.
If I create this table:
create table test (C1 varchar2(10));
create unique index test_index on test (c1);
insert into test (c1) values ('+2');
insert into test (c1) values ('-2');
insert into test (c1) values ('+1');
insert into test (c1) values ('-1');
select * from test order by c1;
The following listing shows the output:
C1
----------
+1
-1
+2
-2
How come????
|
|
|
Re: Oracle-Sql [message #370400 is a reply to message #370399] |
Mon, 20 September 1999 09:40 |
m a sivan
Messages: 34 Registered: July 1999
|
Member |
|
|
check up the dump and u will come to know the answer urself.. say
select dump(c1) from test..
now the soln..
since u have taken varchar... make it either number or if u know that u are only storing numbers
then change index to
create unique index test_index on test (to_number(c1));
|
|
|
|
|