Hi,

perhaps try :

ORDER BY SUBSTRING_INDEX(your_field, '-', 1) asc,SUBSTRING_INDEX(your_field,
'-', 2) asc,SUBSTRING_INDEX(your_field, '-', 3) asc;

Regards,
  Jocelyn
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 13, 2002 4:38 PM
Subject: Order issue with MySQL


> Hello All,
>
> Using MySQL for sql...webpage forms:
>
> I am trying to order the following:
>
> 1-03-0A001....9-03-0D004;
>
> this works fine using simple "order by asc".
>
> when I added 11-02-0B001, etc. it came after "1-03-
> 0D004, then continued to rest of order.
>
> how do I fix this so that 11-xx-xxx comes after 9-xx-
> xxx? The first "digit" is numbered as "odd".
>
>
> thanks,
>
> Lamar
>
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
<[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
>
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to