sql 分页查询问题,时间范围大的,反而快,这是为什么呢?
谁可以解释一下为什么~--快selecttop16*fromVXFDetailwherenotIDnotin(selecttop(1*16)IDfromVXFDetail...
谁可以解释一下为什么~
--快
select top 16 * from VXFDetail where not ID not in ( select top (1*16) ID from VXFDetail where 1=1
and Date_Time between '2015-01-05 00:00:01' and '2015-01-13 00:00:59' order by Date_Time desc ,ID desc )
and Date_Time between '2015-01-05 00:00:01' and '2015-01-13 00:00:59' order by Date_Time desc 展开
--快
select top 16 * from VXFDetail where not ID not in ( select top (1*16) ID from VXFDetail where 1=1
and Date_Time between '2015-01-05 00:00:01' and '2015-01-13 00:00:59' order by Date_Time desc ,ID desc )
and Date_Time between '2015-01-05 00:00:01' and '2015-01-13 00:00:59' order by Date_Time desc 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询