Date: 06/04/01
- Next message: Forrest J Cavalier III: "[phplib] Bugs in db_mysql.inc ?"
- Previous message: HurricaneIndy <email protected>: "Re: [phplib] OT:Query with sort order numerical"
- In reply to: White, Bob: "[phplib] OT:Query with sort order numerical"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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>
- Next message: Forrest J Cavalier III: "[phplib] Bugs in db_mysql.inc ?"
- Previous message: HurricaneIndy <email protected>: "Re: [phplib] OT:Query with sort order numerical"
- In reply to: White, Bob: "[phplib] OT:Query with sort order numerical"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

