declare @count int,@countT int,@countSum int = 0 将 'Local144' 'AliP001' 都放入到一个临时表中,采用游标从这个临时表遍历 select @count = COUNT(1) from T_WeiBo_Task with(nolock) where servername =@temp and Status is null
if(@count<10) begin set @countSum = @countSum +(50-@count) end 找到了就退出游标循环
将 'Local144' 'AliP001' 都放入到一个临时表中,采用游标从这个临时表遍历
select @count = COUNT(1) from T_WeiBo_Task with(nolock) where servername =@temp and Status is null
if(@count<10)
begin
set @countSum = @countSum +(50-@count)
end
找到了就退出游标循环