List:Brisbane MySQL Users Group« Previous MessageNext Message »
From:Paul McArdle Date:September 15 2005 8:34pm
Subject:RE: Sort Order
View as plain text  
select  left('SPK1234-6k',7) as bit_a, mid('SPK1234-6k',9,6) as bit_b ;

+----------------------+-----------------------+
| left('SPK1234-6k',7) | mid('SPK1234-6k',9,6) |
+----------------------+-----------------------+
| SPK1234              | 6k                    |
+----------------------+-----------------------+

ORDER BY  bit_a, integer( bit_b )
the cast should ignore trailing 'k'|'K' otherwise try to pull out the size 
by searching for the position of the 'k'|'K' and do another mid/left etc.


Thread
Sort OrderAussieGuy15 Sep
RE: Sort OrderPaul McArdle15 Sep