这个sql语句应该怎麽写

来源:百度知道 编辑:UC知道 时间:2024/05/27 04:43:02
恩..asp的
就是网叶上那种
上一篇文章
下一篇文章
假设当前业为6的话..应该怎麽写

我空间有``去看

//存储过程[有自增字段的,若无自增ID的可以通过新建临时表完成]
create proc tt
@currentpage int,--当前页
@pagesize int--每页记录数
as
begin
declare @temp
declare @sql
set @temp=(@currentpage-1)*@pagesize
set @sql='select top '+cast(@pagesize as varchar(20))+' * from table1 where id not in(select top '+cast(@temp as varchar(20))+' id from table1)'
exec(@sql)
end