到目前为止,我已经在 stackoverflow 上看到了针对此问题的解决方案,而且每个解决方案似乎都不同。所以我决定提出一个新问题。
我的目标是使用递增伤害创建一个排名列...
SET @rownum := 0;
SELECT rank, damage, playerID FROM (
SELECT @rownum := @rownum + 1 AS rank, damage, playerID
FROM PlayerStats WHERE playerID > 20130000000000 ORDER BY damage DESC, modified ASC
) as result WHERE playerID='20130000000004'
但是,它会报告“字段列表中的未知列“损坏””
"playerID","ancientBossID","damage","eventEnergy"
"20130000000004","2012000000000382","19033","38"
"20130000000078","2012000000000019","0","30"
"20130000000066","2012000000000242","0",30"
"20130000000080","2012000000000024","270","25"
"20130000000041","2012000000000133","5808","2"
"20130000000071","2012000000000030","694","30"
"20130000000055","2012000000000189","0","30"