Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: order by
"XelA" <asilic_at_net.hr> wrote in message
news:a9gsen$kcu$1_at_sunce.iskon.hr...
> <meurer_at_swms.de> wrote in message
news:a9gs6j$gju$02$1_at_news.t-online.com...
>
> Hello,
>
> I have an ordering problem. I wish to order the strings in the table
> 'tab_test' as an incremented statement. But the problem is that
oracle can't
> recognize that the number '10' as a number.
It is treating it as a string and sorting it by ASCII code.
To efficiently solve this problem, you can do one of several things:
SQL> select * from fiz order by col_1;
COL_1
SQL> select * from fiz order by to_number(substr(col_1,2));
COL_1
SQL>
-- Pablo Sanchez, High-Performance Database Engineering mailto:pablo_at_hpdbe.com Available for short-term and long-term contractsReceived on Tue Apr 16 2002 - 10:33:18 CDT