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: how to sort numbers in varchar2

Re: how to sort numbers in varchar2

From: PQ <paulq_1998_at_yahoo.com>
Date: Tue, 08 Jul 2003 01:30:41 GMT
Message-ID: <59pOa.81118$x4o.59567@news04.bloor.is.net.cable.rogers.com>


select lpad(your_column,max_size)
from your_table
order by 1

"Susan Lam" <susana73_at_hotmail.com> wrote in message news:7186ed56.0307071524.17448526_at_posting.google.com...
> I have a varchar2 column which stores characters as well as numbers in
> string such as '12345'. I would like to sort the column so that it
> orders by the actual number in the number string. However, if I do a
> simple order by, 111 is smaller than 22. Is there a easy way to
> accomplish this in sql instead of doing in programming?
>
> Thanks,
> Susan
Received on Mon Jul 07 2003 - 20:30:41 CDT

Original text of this message

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