请问,在SQLSERVER中,一张表有10000条数据,如何取出第10条至第100条数据?

如题所述

创建一张临时表,设置一个ID为自增长并且包含需要查询表的所有字段,把你要查询的表全部插进去,这样你再通过刚才设置的自增ID取出10到100行的就行了
温馨提示:答案为网友推荐,仅供参考
第1个回答  推荐于2018-04-10
select top 91 *
from 表
where 表id not in (select top 9 表id from 表)
10到100是91条记录.我这句的意思是,查找前91条记录,记录不在当前表的前9条中.本回答被网友采纳
第2个回答  2011-01-14
select * from
(select * ,row_number() over(order by id) as row) a
where row between 10 and 100
这样的网络上很多,比如分页存储过程里面就有比较典型的案例
第3个回答  2011-01-20
select top 90 * from Table_name where 主键 not in (select top 10 主键 from Table_name order by 主键) order by 主键
第4个回答  2011-01-20
select top 91 * from a where id not in(select top 10 * from a)