sql 分页

sql 分页

alter proc P_Order
@n int ,@m int --n条 m 页
As
select top (@n) * from dbo.[Order Details] where OrderID not in ( select top ((@m -1)*@n) OrderID from dbo.[Order Details] order by OrderID) order by OrderID

exec P_Order @n=10,@m=8

转载 请注明原文地址并标明转载:http://www.cnblogs.com/laopo 商业用途请与我联系:lcfhn168@163.com
原文地址:https://www.cnblogs.com/laopo/p/4537063.html