方法1 Row_Number() 函数
select * from
(
select *, ROW_NUMBER() OVER (ORDER BY ID) as rank
from users
)
as t where t.rank between 100 and 300
方法2 利用NOT IN
select top 10* from users where FlightsDetailID not in
(
select top 1000 ID from users order by ID
) order by ID
----
sql 查询执行时间分析
SET STATISTICS PROFILE ON
SET STATISTICS IO ON
SET STATISTICS TIME ON
/*--你的SQL脚本开始*/
/*你的SQL脚本结束*/
SET STATISTICS PROFILE OFF SET STATISTICS IO OFF SET STATISTICS TIME OFF