【发布时间】:2010-04-19 11:28:04
【问题描述】:
这个问题在客户端很容易解决。但为了性能,我想直接对数据库进行操作。
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;
【问题讨论】:
-
您好 Fredrik,您具体需要什么,您能解释一下吗?