分页存储过程问题(更多细节参看分页存储过程):1 如果有unique字段,可以使用下面的语句:
select top 10 * from tablename
where UniqueID not in(
select top 10 UniqueID from tablename
)
2 假如没有unique字段,可以这样:
select top 10 * from tablename(
select top 20 * from testCatogary
)a
order by [id] desc
select top 10 * from tablename
where UniqueID not in(
select top 10 UniqueID from tablename
)
2 假如没有unique字段,可以这样:
select top 10 * from tablename(
select top 20 * from testCatogary
)a
order by [id] desc
然后DECLARE @id int
SET ROWCOUNT x
select @id=[id] from tablename
SET ROWCOUNT y-x
select * from tablename where id>@id
SET ROWCOUNT 0