select * from (select ROW_NUMBER() OVER() num , TABLENAME.* FROM TABLENAME ) AS RANKED_TABLE where num < 10 -- -------------------------------------------------- ------------------ ----------------- --------------------------- ---------------------- Example: