Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Sorting numbers on a VARCHAR2 field
Hi-
Try following stmt. It might work.
Assuming that column width is 10.......
select column1 from table1 order by lpad(column1,10,null);
Hope this helps.
Thanks
In article <01c04789$960e8700$db671eac_at_icwkcheah>,
"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???
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Sun Nov 05 2000 - 21:08:01 CST