一般性方法:set rowcount 10 select * into # from 表 set rowcount 5 delete from # select * from # drop table # set rowcount 0
上面是取6-10,如果是5-10:select top 6 * from 表 where 主键 not in (select top 4 主键 from 表 order by 主键) order by 主键 set rowcount 10 select * into # from 表 set rowcount 4 delete from # set rowcount 0 select * from # drop table #
select * into # from 表
set rowcount 5
delete from #
select * from #
drop table #
set rowcount 0
where 主键 not in (select top 4 主键 from 表 order by 主键)
order by 主键
set rowcount 10
select * into # from 表
set rowcount 4
delete from #
set rowcount 0
select * from #
drop table #