标签:
declare @pagesize integer,@cpage integer; set @pagesize =500; set @cpage = 1; SELECT TOP (@pagesize) * FROM (SELECT row_number() over(order by MemberID) as row_number,* FROM (SELECT * FROM Member WHERE 1=1 ) Temp ) TEMPTABLE WHERE 1=1 AND row_number NOT IN( SELECT TOP ((@cpage - 1) * @pagesize) row_number FROM (SELECT row_number() over(order by MemberID) as row_number,* FROM (SELECT * FROM Member WHERE 1=1 ) Temp ) TEMPTABLE WHERE 1=1 ORDER BY row_number ASC ) ORDER BY row_number ASC;
标签:
原文地址:http://www.cnblogs.com/rinack/p/5000185.html