查询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 所以很快
第二页就是如上的语句,执行起来的一分钟左右,请教高手

解决方案 »

  1.   

    access语法不熟,你看看有没有生成一个需要的,插入临时表,对这个需要价格索引,然后应该可以加快速度,另外不要not in,直接betwwen and你需要的行就可以了
      

  2.   

    谢谢,我用select top 每页数量 * from 表 where id >(select top 1 max(id) from (select top (页数-1)*每页数量 from 表 order by id,name))    或
    select top 每页数量 * from 表 where id <(此处根据顺序和逆序)*/这种方式解决了
      

  3.   

    发现.net 调用access数据库的写法和直接在 access数据库中的查询写法不一样,.net中中用的是%号,access中用的是*号