Re: [phplib] OT:Query with sort order numerical From: Stephen Woodbridge (woodbri <email protected>)
Date: 06/04/01

I'm not sure you really want to do this or if it will work in Oracle but
in MySQL your sort on

0+reverse(substring(reverse(mycol),1,locate("-",reverse(mycol),1)-1))

where mycol is the column with your entries below.

YMMV,
  -Steve

"White, Bob" wrote:
>
> Hi All,
> I know this is off topic, but does anyone know how to use just the numerical
> part of a string as the sort order in an oracle query?
>
> Entries like :
>
> P-CDP-5000
> P-CDP-2137
> LT-123
> C-CDP-5000
> IJB-33875
>
> Would be:
>
> LT-123
> P-CDP-2137
> C-CDP-5000
> P-CDP-5000
> IJB-33875
>
> A way of masking off all alphabetical characters and sorting only by the
> numeric values.
>
> Any Suggestions would be appreciated,
>
> Bob White
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: phplib-unsubscribe <email protected>
> For additional commands, e-mail: phplib-help <email protected>

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>