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