有没有sql语句可以取出数据表中的第N条到第N+20条记录的语句?比如我取出一个表中的第20条到第40条的数据!谢谢!!!

解决方案 »

  1.   

    关注,以前见过,不记得了,set merge start 和end 吧...
      

  2.   

    我只知道取前10条是select top 10 * from tablename 
      

  3.   

    alter table add id identity(1,1)
    select * from table where id between(n,n+20)
    alter table drop column id
      

  4.   

    没意义,关系数据库中是用主健唯一标识一条记录的,没有什么第几条,只有用select语句返回一个数据集才有第几条的概念
      

  5.   

    select top 20 * from t1 where id not in (select top 20 id from t1):<
      

  6.   

    select top 100 * from table 最前100条
    select top 100 * from table order by bh desc最后100条
    select top 100 * from table where bh>100 and bh<200  分页取100-200条
      

  7.   

    select top 20 from t1 where id not in (select top 20 id from t1)