22,210
社区成员
发帖
与我相关
我的任务
分享
Declare @tb table([id] int);
insert into @tb([id])
select [id] from [table] where [flag]=0;
update a set [flag]=1 From [table] as a join @tb as b on a.[id]=b.[id];
select a.* from [table] as a join @tb as b on a.[id]=b.[id];