select top 10 * From soft where   id not in 
  (select top 1 id From soft where class='应用软件' order by ID desc) 
    order by ID desc高手指教下查出来的全是同一条数据  id 1-8的为了方便查看我把里面查询那个top值改成1  其实是 "当前页乘以每页显示的条数"

解决方案 »

  1.   

    你class='应用软件'的数据有几条呀??
      

  2.   

     分页前后的查询条件应该是一致的,不然就会出现错误的情况。。  select top 10 * From soft where class='应用软件' and  id not in 
      (select top 1 id From soft where class='应用软件' order by ID desc) 
        order by ID desc 
      

  3.   

    不清楚你的逻辑要查什么东西,所以不知道写得对不对
    你这样写是排除了class='应用软件'的id最大的那条数据,然后取其他所有记录id最大的10条(包括class='应用软件'的,也包括不等于的,只排除了等于而且id最大的那一条数据)
    如果你的逻辑确实是要这样,那就没错了,至于会不会显示10条,要看你总共符合条件的有多少
      

  4.   

    select top 10 * From soft where class='应用软件' and  id not in 
      (select top 1 id From soft where class='应用软件' order by ID desc) 
        order by ID desc 
      

  5.   

    select top 10 * From soft where  id not in 
      (select top 1 id From soft where class='应用软件' order by ID desc) 
        order by ID desc 
    错了
    比如说第二页,sql就应该是
    select top 2×10 * From soft where  id not in 
      (select top 1×10 id From soft where class='应用软件' order by ID desc) 
        order by ID desc 
    取出前20页,不包含前10页的,这才对你这个永远都是取前10条不包含第一条的