我有一個表MySQL的ORDER BY場加場
id type left right
1 featured 1 2
2 default 3 1
3 default 5 2
4 default 2 7
5 featured 3 4
6 featured 3 2
7 day 1 3
8 default 12 42
我需要輸出5個id其中type != day
和sum(left + right)
排序並通過功能排序,默認
首先,需要各方面的功能類型ORDERING by sum(left + right)
,比type = dafule ordering by sum(left + right) LIMIT 5
我想什麼:
5, 6, 1, 8, 4
謝謝!
您是否希望將結果作爲單個字符串的ID排序,或者結果集或行是否正確。我明白回報集的順序依據。 – DRapp 2012-02-08 12:51:20