首页 >数据库 >mysql教程 >SQLServer2005 分页SQL

SQLServer2005 分页SQL

WBOY
WBOY原创
2016-06-07 17:40:361221浏览

声明@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

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn