select top 10 * from 表
where id not ni 
(select top 4 id from 表)

解决方案 »

  1.   

    in 写成ni了
    应该是select top 10 * from 表
    where id not in
    (select top 4 id from 表)
      

  2.   

    select * into # from 表
    set rowcount 5
    delete from #
    select * from #
    set rowcount 0
    drop table #
      

  3.   

    嗯……
    SELECT TOP 6 t1.*
    FROM (SELECT TOP 10 *
            FROM table
            ORDER BY id DESC) t1
      

  4.   

    給點啟發﹕看下面的
     查询第X页,每页Y条记录
    最基本的处理方法(原理):
    如果表中有主键(记录不重复的字段也可以),可以用类似下面的方法,当然y,(x-1)*y要换成具体的数字,不能用变量:
    select top y * from 表 where 主键 not in(select top (x-1)*y 主键 from 表)如果表中无主键,可以用临时表,加标识字段解决.这里的x,y可以用变量.
    select id=identity(int,1,1),*  into #tb from 表
    select * from #tb where id between (x-1)*y and x*y-1
      

  5.   

    这个都属于分页吧
    学习 -。-
    当初做的时候都是把记录全读出来
    在根据rs.pagesize来计算的
      

  6.   

    select top 6 * from 表
    where id not in
    (select top 4 id from 表)
      

  7.   

    select top 6 * from 表 where id>(select max(id) from (select top 4 id from 表 order by id ) as tt)