声明@pagenum int = 1;声明@pagesize int = 3;WITH Tmp AS (SELECTROW_NUMBER() OVER (ORDER BY uid ASC) AS colnum,uid,unameFROM dbo.users o1)SELECT uid,uname FROM TmpWHERE colnum( @pagenum-1)*@pagesize AND colnum=@pagenum*@pagesize;
声明 @pagenum int = 1; 声明 @pagesize int = 3; 与 Tmp AS ( SELECT ROW_NUMBER() OVER (ORDER BY uid ASC) AS 列, uid, 乌纳梅 来自 dbo.users o1 ) 从 Tmp 中选择 uid、uname WHERE colnum>(@pagenum-1)*@pagesize AND colnum