下面的數據是字符串列,按升序排序:自定義排序在mysql中
1/44/104/66
1/44/104/66/137
1/44/104/66/138
1/44/104/66/139
1/44/104/66/140
1/44/104/66/141
1/44/104/66/142
1/44/104/66/143
1/44/104/66/67
1/44/104/66/68
1/44/104/66/69
不過,我想這樣的排序是:
1/44/104/66
1/44/104/66/67
1/44/104/66/68
1/44/104/66/69
1/44/104/66/137
1/44/104/66/138
1/44/104/66/139
1/44/104/66/140
1/44/104/66/141
1/44/104/66/142
1/44/104/66/143
AFIK這在SQL中是不可能的。 – rekire
你只是按最後一列排序?用簡單的英語,你會如何描述這種類型? –
你可能在這裏找到一些關於將字段作爲整數進行數值排序的答案:http://stackoverflow.com/questions/4686849/sorting-varchar-field-numerically-in-mysql – showdev