我有一個數據集是這樣的:MySQL的切片訂貨
boolean name value
0 Text10 20
1 Text1 8
0 Text4 46
1 Text9 84
1 Text5 66
0 Text2 35
0 Text9 2
1 Text6 55
排序由boolean
列會分裂,我想根據每一個不同的參數來訂購兩個部分數據:與boolean = 1
的那些是按值排序,其餘是由name
有序的,就像這樣:
boolean name value
1 Text1 8 # --> 1s are ordered by value
1 Text6 55
1 Text5 66
1 Text9 84
0 Text2 35 # --> 0s are ordered by name
0 Text4 46
0 Text9 2
0 Text10 20
注:我們需要這在MySQL 4.1.11工作。 = D
4.1.11 OMG!所以對不起你的男人.... – Ray
謝謝@Ray,但我很抱歉。 = p – vmassuchetto