游标的使用方法
游標的使用方法
select * from a
select * from b
declare Mycursor CURSOR
for select * from b
open Mycursor
declare @stuID nchar(10)
declare @math smallint
fetch next from Mycursor
into @stuID,@math
while(@@FETCH_STATUS = 0)
begin
?update a set math = @math where stuID = @stuID
?fetch next from Mycursor
?into @stuID,@math
end
close Mycursor
轉(zhuǎn)載于:https://www.cnblogs.com/nine425/archive/2010/03/29/1699451.html
總結(jié)
- 上一篇: C++中的namespace ----转
- 下一篇: 子网掩码,可变长子网掩码,ABC类IP网