SQL循环表里的数据

select * into #t1 from Userinfo
declare @id varchar(2000);
while (exists(select ProjectID from #t1))
begin
select @id=userid from #t1
delete #t1 where ProjectID=@id
end
drop table #t1

原文地址:https://www.cnblogs.com/Children-qiuzhen/p/10142490.html