2
我想在表中的行通過colomn 「值」,其中字段= 「訂單」 進行排序,通過的ObjectId分組行:MySQL的排序行的記錄組
Id | ObjectId | Field | Value
------------------------------
1 | 1 | size | big
2 | 1 | order | 2 //unsorted
3 | 2 | size | small
4 | 2 | order | 1 //unsorted
5 | 3 | size | medium
6 | 3 | order | 3 //unsorted
預期結果:
Id | ObjectId | Field | Value
------------------------------
3 | 2 | size | small
4 | 2 | order | 1 //sorted
1 | 1 | size | big
2 | 1 | order | 2 //sorted
5 | 3 | size | medium
6 | 3 | order | 3 //sorted