--使用sql2005实现分页
--select row,ProductId,ListPrice,unitcost
--from (
-- select ROW_NUMBER() over (order by itemid) as row,productid,Listprice,unitcost
-- from item
-- )as temp
--where row>=6 and row<=10
--使用表变量实现分页
--DECLARE @tempTable TABLE
--(
-- RowNum int,
-- ProductId varchar(10),
-- ListPrice decimal(10,2)
--)
--INSERT INTO @tempTable
--SELECT ROW_NUMBER() over (ORDER BY ItemId) as Row,ProductId,ListPrice
--from Item
--select Productid,listprice
--from @tempTable
--where rownum>=6 and rownum<=10
--如果没有ROW_NUMBER()这个内置函数,那么可以用:临时表 注意使用IDENTITY
--CREATE TABLE #TempTable
--(
-- RowNum int not null IDENTITY,
-- ProductId varchar(10),
-- ListPrice decimal(10,2)
--)
--INSERT INTO #TempTable (ProductId,ListPrice)
--SELECT productid,listprice
--FROM Item
--SELECT rownum,productid,listprice
--FROM #TempTable
--WHERE RowNum>=6 and RowNum<=10
--SELECT rownum,productid,listprice
--FROM #TempTable
--WHERE RowNum>=11 and RowNum<=15