Gunakan CTE (Common Table Expression) - semacam tampilan "sebaris" hanya untuk pernyataan berikutnya:
;WITH MyCTE AS
(
SELECT
RANK() OVER(PARTITION BY XXX ORDER BY yyy,zzz,oooo) as ranking,
*
FROM SomeTable
)
SELECT *
FROM MyCTE
WHERE ranking = 1 --> this is now possible!