WHERE
を移動できます ランキング計算結果からの節。
例 :
SELECT * FROM (
SELECT
`item`, (`totalrate` / `nrrates`) AS `rank`,
@curRank := @curRank + 1 AS `ranking`
FROM `rtgitems`, (SELECT @curRank := 0) r
ORDER BY (`totalrate` / `nrrates`) DESC
LIMIT 10
) results
WHERE item REGEXP 'kelly'