日期:2014-05-18 浏览次数:20567 次
DECLARE @A001 char(100),@A005 Numeric(16,6),@A006 Numeric(16,6) SELECT @A006 = 0 DECLARE CAAA CURSOR FOR SELECT A001,A005 FROM @AA FOR UPDATE OPEN CAAA Fetch Next FROM CAAA INTO @A001,@A005 WHILE(@@FETCH_STATUS = 0) UPDATE @AA SET A006 = @A006 + A005 FROM @AA WHERE CURRENT OF CAAA Fetch Next FROM CAAA INTO @A001,@A005 CLOSE CAAA DEALLOCATE CAAA
DECLARE @A001 char(100),@A005 Numeric(16,6),@A006 Numeric(16,6) SELECT @A006 = 0 DECLARE CAAA CURSOR FOR SELECT A001,A005 FROM @AA FOR UPDATE OPEN CAAA Fetch Next FROM CAAA INTO @A001,@A005 WHILE(@@FETCH_STATUS = 0) BEGIN UPDATE @AA SET A006 = @A006 + A005 FROM @AA WHERE CURRENT OF CAAA Fetch Next FROM CAAA INTO @A001,@A005 END CLOSE CAAA DEALLOCATE CAAA