たとえば、アイテム名のテーブルがあります。
...
Cheburashka with detailed ear 10g. (O.Box 5 pcs.)
Cheburashka with detailed ear 12g. (O.Box 5 pcs.)
Cheburashka with detailed ear 4g. (O.Box 5 pcs.)
Skittle with two swivels 20g. (O.Box 5 pcs.)
Skittle with two swivels 6g. (O.Box 5 pcs.)
...
そして、私は必要です:
...
Cheburashka with detailed ear 4g. (O.Box 5 pcs.)
Cheburashka with detailed ear 10g. (O.Box 5 pcs.)
Cheburashka with detailed ear 12g. (O.Box 5 pcs.)
Skittle with two swivels 6g. (O.Box 5 pcs.)
Skittle with two swivels 20g. (O.Box 5 pcs.)
...
など、行をアルファベット順に並べ替える必要があり、値の数字 - 重み.
SQL Fiddle リンク - http://sqlfiddle.com/#!2/4cbd8/1
LENGTH()
、CAST()
、で行を並べ替えようとしましSUBSTRING_INDEX()
たが、すべて失敗しました。