当前位置: 代码迷 >> Sql Server >> 删除表里的后5000条数据,该怎么处理
  详细解决方案

删除表里的后5000条数据,该怎么处理

热度:83   发布时间:2016-04-27 18:54:53.0
删除表里的后5000条数据
一个表里面有1万多条数据
我现在要删除他的后5000条

A表
id     name
1       a
2       b
...   ...

怎么弄?

------解决方案--------------------
ID 大的一定在后面吗、

delete from table1 where id in (select top 5000 id from table1 order by Convert(int ,id) desc)
  相关解决方案