Sql分页,Sql2000/2005适用

来源:互联网 发布:生意参谋数据分析2017 编辑:程序博客网 时间:2024/06/06 00:17

create table #tempOrders --创建临时表
(
row smallint not null IDENTITY(1,1),
CustomerID nchar(5) null,
EmployeeID int null,
ShipCity nvarchar(15) null
)

--填充临时表
insert into #tempOrders(CustomerID,EmployeeID,ShipCity) select CustomerID,EmployeeID,ShipCity From Orders

--获取分页数据
select * from #tempOrders where row>=5 and row<=10

 

Marked

原创粉丝点击