Use [test]
declare my_cur cursor for
select name,Value from [Result]
declare @s nchar(10)
declare @a float
declare @c float
open my_cur
fetch next from my_cur
into @s,@a,@c
while @@fetch_status = 0
begin
if @c = 2
begin
update [Result] set [Value] = -1 where [Value] = @c
end
fetch next from my_cur
into @s, @a, @c
end
close my_cur
deallocate my_cur
SQL游标使用例
最新推荐文章于 2024-06-16 00:59:54 发布