select top 5 * from tb_abc这是取前5条,我想取非前五条的语句.怎么写

解决方案 »

  1.   

    需要有关键字的,如果关键字为n_id,你可以看到对应找到数据的行号
    select *,(select count(*) from tb_test where n_id<=a.n_id) from tb_test a
    where (select count(*) from tb_test where n_id<=a.n_id)>5
      

  2.   

    select top 5 * from tb_abc SELECT IDD=IDENTITY(INT,1,1),* INTO #T FROM tb_abc SELECT * FROM #T WHERE IDD>5
      

  3.   

    不就和翻页一样么?
    select * from tb_abc where 主键 not in (select top 5 主键 from tb_abc )
      

  4.   

    select * from tb_abc where id not in (select top 5 id from tb_abc )
      

  5.   

    有唯一字段么?有唯一字段用子查询就能实现,没有的话用临时表添加1个identity列,然后再查询
      

  6.   

    select * from tb_abc where id not in (select top 5 id from tb_abc ) 用子查询就能实现。
      

  7.   

    select top 5 * from tb_abc 
    楼主你就用总记录减去它吗
      

  8.   

    select
      *
    from
      (select id=row_number()over(order by getdate()),* from tb)t
    where
      id>5
      

  9.   


    select * from tb where id not in (select top 5 id from tb)--orselect * from tb t1 where not exists (select top 5 from tb t2 where t1.id=t2.id)