SQLServer2005+分页SQL
程序员文章站
2022-04-10 20:33:14
...
declare @pagenum int = 1;declare @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;
declare @pagenum int = 1; declare @pagesize int = 3; WITH Tmp AS ( SELECT ROW_NUMBER() OVER (ORDER BY uid ASC) AS colnum, uid, uname FROM dbo.users o1 ) SELECT uid,uname FROM Tmp WHERE colnum>(@pagenum-1)*@pagesize AND colnum
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。
下一篇: 解析ASP.NET页面传值的方法技巧