MySql逻辑顺序 [英] MySql Logical Order By
本文介绍了MySql逻辑顺序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我目前有这样的查询:
SELECT 'id', 'clanid', 'name',
'level', 'exp', 'warwinpercent',
'warswon', 'warslost', 'warstied',
'playercount', 'score'
FROM clans
WHERE warswon >= 100
ORDER BY warwinpercent DESC, warswon DESC;
现在可以正常工作了,但最终它不像我希望的那样合理...
Now that works but in the end it isn't as logical as I would hope it could be...
例如.
比方说,这里有99.5738%的战争获胜率和208战争的获胜率. 另一个具有100%的战争胜利率和103次战争的胜利.
Let's say there is a row which has 99.5738% war win percent and 208 wars won. And another which has 100% war win percent and 103 wars won.
我希望99%的行高于100%的行.我有什么办法让它正常工作吗?
I'd want the 99% row to be above the 100% row. Is there any way for me to get this working?
我想要的等式是:
warinpercent = warswon/(warswon+warstied+warlost)*100
order by warwinpercent
if warwinpercent are in a range of 3% then order by warswon between them.
推荐答案
查看全文