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: Sorting numbers on a VARCHAR2 field

Re: Sorting numbers on a VARCHAR2 field

From: Yannick Kermabon <y.kermabon_at_tegelog.fr>
Date: Mon, 06 Nov 2000 13:50:00 GMT
Message-ID: <3a06b690.21289913@news.fr.uu.net>

Hi

You can do this :

select *
from mytable
order by to_number(varchar_column);

hth
Yannick

On Mon, 06 Nov 2000 00:36:47 GMT, "Greg Wong" <gregory.wong_at_clear.co.nz> wrote:

>Hi,
>
>I want to sort a field that contains numbers but when I do a order by in
>the SQL query it sorts them by their ASCII values rather than their face
>value..ie the numbers appear in this order : 1,10,11,2,20,21
>
>I could can the field's datatype to a number but some of the values in this
>field are also alphanumeric.
>
>Is there a way to get around this???
Received on Mon Nov 06 2000 - 07:50:00 CST

Original text of this message

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