只有先删除,然后将结果集存在临时表。然后初始化表,再将临时表中的数据插入表中
delete 表 where id in(3,4)
select * into #temp from 表
truncate table 表
insert into 表 select 姓名 from #temp
delete 表 where id in(3,4)
select * into #temp from 表
truncate table 表
insert into 表 select 姓名 from #temp
本文介绍了一种使用SQL进行数据批量更新的方法:通过先删除特定记录,利用临时表保存结果,清空原始表后再重新导入数据,以此实现高效的数据管理。
855

被折叠的 条评论
为什么被折叠?



