怎么获得第20到第30条之间的数据(id 是主键)
select top 30 * from orders where id not in ( select top 20 id from orders)这有什么错啊?怎么不行呢?

解决方案 »

  1.   

    select top 10 * from orders where id not in ( select top 20 id from orders order by id)
      

  2.   

    select top 11 * from orders where id not in ( select top 20 id from orders)
      

  3.   

    怎么获得第20到第30条之间的数据(id 是主键)select top 11 * from orders 

    select top 30 * from orders order by id desc
    )A
      

  4.   

    select top 10 * from orders where id not in ( select top 20 id from orders)
      

  5.   

    select top 10 * from orders where id not in ( select top 20 id from orders)
      

  6.   

    select top 10 * from orders as a where not exists ( select top 20 id from orders where id=a.id order by id)