代码
select * from(select *, ROW_NUMBER() OVER (order by id) as rownum from Categories ) as T where rownum BETWEEN 1 and 4
SELECT Top 10 * FROM books WHERE id NOT IN
(SELECT Top 20 id FROM books ORDER BY UnitPrice,id)
ORDER BY UnitPrice,id
SELECT * FROM (SELECT ROW_NUMBER() OVER (ORDER BY UnitPrice,id) AS PriceRank,* FROM books) AS Rank
WHERE PriceRank BETWEEN 21 AND 30
ORDER BY UnitPrice,id
SELECT Top 10 * FROM books WHERE id NOT IN
(SELECT Top 20 id FROM books ORDER BY UnitPrice,id)
ORDER BY UnitPrice,id
SELECT * FROM (SELECT ROW_NUMBER() OVER (ORDER BY UnitPrice,id) AS PriceRank,* FROM books) AS Rank
WHERE PriceRank BETWEEN 21 AND 30
ORDER BY UnitPrice,id