SELECT *,`kills`-`deaths` as x FROM `users` ORDER BY `x` DESC LIMIT 0,50;
桌子:
user|kills|deaths
a | 10 | 9
b | 11 | 9
c | 0 | 0
d | 0 | 0
e | 0 | 0
f | 1 | 5
输出将是:
b | 2
a | 1
c | 0
d | 0
e | 0
f | -4
我需要这样的输出:
b | 2
a | 1
f | -4
c | 0
d | 0
e | 0
因为用户是活跃的并且他有杀戮和死亡,其他用户是不活跃的,所以他们走到了底部。
怎么做 ?