select *
from tablename
where 主键 not in (select top 20 主键 from tablename )

解决方案 »

  1.   

    如果表中存在唯一索引列(如id):
    select * from t where id not in(select top 20 id from t)如果表中不存在唯一索引列:
    select identity(int,1,1) as tid,* into #t from t
    delete #t where id <= 20
    alter table #t drop tid
    select * from #t
      

  2.   

    select identity(int,1,1) as id ,* into # from 表select * from # where id>20