Claire Lee wrote:
> I need to order a few names by the number following
> the main name. For example swap2, swap3, swap10 in the
> order of swap2, swap3, swap10, not in swap10, swap2,
> swap3 as it will happen when I do an order by.

   ... ORDER BY ABS(SUBSTRING(secname,5)) ...

   will insure that the trailing digits are treated as numbers :-)
> +----------+------------+
> | secname  | date       |
> +----------+------------+
> | SWAP0.25 | 2005-09-21 |
> | SWAP0.5  | 2005-09-21 |
> | SWAP1    | 2005-09-21 |
> | SWAP10   | 2005-09-26 |
> | SWAP10   | 2005-09-23 |
> | SWAP10   | 2005-09-21 |
> | SWAP2    | 2005-09-26 |
> | SWAP2    | 2005-09-23 |
> | SWAP2    | 2005-09-22 |
> | SWAP2    | 2005-09-21 |
> | SWAP3    | 2005-09-21 |
> | SWAP3    | 2005-09-26 |
> | SWAP3    | 2005-09-23 |
> | SWAP3    | 2005-09-22 |
> | SWAP5    | 2005-09-21 |
> | SWAP5    | 2005-09-26 |
> | SWAP5    | 2005-09-23 |
> | SWAP5    | 2005-09-22 |
> +----------+------------+

HTH,
-- 
Hassan Schroeder ----------------------------- [EMAIL PROTECTED]
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

                          dream.  code.



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to