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;
时间: 2024-11-03 01:40:22