1
這個問題很容易修復客戶端。但是爲了提高性能,我想直接將其寫入數據庫。在一個查詢中訂購混合型混合mysql搜索結果?
LIST a
+------+-------+-------+
| name | score | cre |
+------+-------+-------+
| Abe | 3 | 1 |
| Zoe | 5 | 2 |
| Mye | 1 | 3 |
| Joe | 3 | 4 |
想要檢索沒有重複的加入混合結果。
Zoe (1st highest score)
Joe (1st last submitted)
Abe (2nd highest score)
Mye (2nd last submitted)
...
客戶端我自己採取每個搜索,並通過它們一步。 但在100.000+以上它變得尷尬。爲了能夠使用LIMIT功能將會使事情變得更加輕鬆!
SELECT name FROM a ORDER BY score DESC, cre DESC;
SELECT name FROM a ORDER BY cre DESC, score DESC;
Hello Fredrik,你準確的需要你解釋一下嗎? – Karthik 2010-04-19 11:38:59