Declare @i intset @i=1while @i<11 begin update sx set fs= case when case when substring( content,i,1)= substring(da,i,1) then 4 else 0 end select @i=@i+1 end
Declare @i int,@sumset @i=1 update sx set fs=0 while @i<11 begin
update sx set fs= fs+case when case when substring( content,i,1)= substring(da,i,1) then 4 else 0 end select @i=@i+1 end 上面那个没有累加,有问题
Declare @i intupdate sx set fs=0set @i=1 while @i<11 begin update sx set fs= fs+(case when substring( content,@i,1)= substring(da,@i,1) then 4 else 0 end) select @i=@i+1 end
Declare @i int,@sumset @i=1
update sx set fs=0
while @i<11
begin
update sx set fs= fs+case when case when substring( content,i,1)= substring(da,i,1) then 4 else 0 end
select @i=@i+1
end
上面那个没有累加,有问题
Declare @i intupdate sx set fs=0set @i=1
while @i<11
begin update sx set fs= fs+(case when substring( content,@i,1)= substring(da,@i,1) then 4 else 0 end)
select @i=@i+1
end