SQL中怎么删除表的前10行或后10行?

前10行:

delete from 表名 where id in(select top 10 id from 表名 order by id)

后10行:

delete from 表名 where id in(select top 10 id from 表名 order by id desc)

你可能感兴趣的:(【SqlServer】,sql,数据库,database)