U kunt de WHERE
. verplaatsen clausule uit de resultaten van de rangschikkingsberekening.
Voorbeeld :
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'