查询3d 的,4000多条数据,每页显示一百条数据,查询第二页的时候,语句如下:
select top 100 qh as 期号,kjdate as 开奖日期, shijnum as 试机号 ,kaijnum as 开奖号,bainum as 百位,shinum as 十位,genum as 个位,hezhinum as 和值 FROM 3d_wgh where qh is not null and idpx not in (select top 100 idpx from 3d_wgh where 1=1 order by idpx desc) order by idpx desc
可是,第一页查询没有 not in 所以很快
第二页就是如上的语句,执行起来的一分钟左右,请教高手
select top 100 qh as 期号,kjdate as 开奖日期, shijnum as 试机号 ,kaijnum as 开奖号,bainum as 百位,shinum as 十位,genum as 个位,hezhinum as 和值 FROM 3d_wgh where qh is not null and idpx not in (select top 100 idpx from 3d_wgh where 1=1 order by idpx desc) order by idpx desc
可是,第一页查询没有 not in 所以很快
第二页就是如上的语句,执行起来的一分钟左右,请教高手
select top 每页数量 * from 表 where id <(此处根据顺序和逆序)*/这种方式解决了