Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Alphanumeric Sort

Re: Alphanumeric Sort

From: <jeperkins4_at_my-deja.com>
Date: Wed, 25 Aug 1999 05:15:36 GMT
Message-ID: <7pvu5h$5nb$1@nnrp1.deja.com>


In article <7ptlk1$3ck$1_at_oceanite.cybercable.fr>,   "Michel Cadot" <micadot_at_netcourrier.com> wrote:
> Assuming that the form of the values of the column
> is zero or more letters followed by 1 or more digits,
> here's a query that make your order:
>
> select * from t
> order by
> decode(instr(translate(col,'0123456789','9999999999'),'9'),
> 1, ' ',
> substr(col,1,instr(translate

(col,'0123456789','9999999999'),'9')-1)),
> to_number(substr(col,instr(translate

(col,'0123456789','9999999999'),'9')))
> ;
>
> johnp_at_1rent.com a écrit dans le message
<7pt94a$aij$1_at_nnrp1.deja.com>...
> >Oracle Gurus,
> >
> >I am trying to sort on an alphanumeric column. The default order is:
> >
> >1
> >100
> >11
> >2
> >23
> >7
> >A1
> >A100
> >A2
> >B2
> >
> >The desired order is:
> >
> >1
> >2
> >7
> >11
> >23
> >100
> >A1
> >A2
> >A100
> >B2
> >
> >Any suggestions?
> >
> >Thanks!!!
> >
> >
> >Sent via Deja.com http://www.deja.com/
> >Share what you know. Learn what you don't.
>
>

U da man!!!

Thanks...

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Wed Aug 25 1999 - 00:15:36 CDT

Original text of this message

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