循环遍历表变量

it2022-05-05  138

declare @temp table (    [id] int IDENTITY(1,1),    [Name] varchar(10) ) declare @tempId int,@tempName varchar(10)

insert into @temp values('a') insert into @temp values('b') insert into @temp values('c') insert into @temp values('d') insert into @temp values('e')

WHILE EXISTS(select [id] from @temp) begin select top 1 @tempId = [id],@tempName=[Name] from @temp delete from @temp where [id] = @tempId print  'Name:----'+@tempName end

转载于:https://www.cnblogs.com/binaryworms/archive/2010/04/15/1712424.html

相关资源:各显卡算力对照表!

最新回复(0)