从第5条记录开始取数据.
现在要在一张表中取数据。从第5条记录开始取。每次取10个记录。的分页SQL语句怎么写?
[解决办法]
create proc pro_page
@i int=0
as
select id=identity(int,1,1),* into # from [Table]
select * from # where id between @i*10+5 and (@i+1)*10+5-1
drop table #
发布时间: 2012-01-12 22:11:58 作者: rapoo
从第5条记录开始取数据.
现在要在一张表中取数据。从第5条记录开始取。每次取10个记录。的分页SQL语句怎么写?
[解决办法]
create proc pro_page
@i int=0
as
select id=identity(int,1,1),* into # from [Table]
select * from # where id between @i*10+5 and (@i+1)*10+5-1
drop table #