![]() |
#2
angeloc2006-12-08 16:32
|
declare @i float(8),@j float(8),@d datetime,@count int,@ot float(8)
set @d='2005-1-1'
set @count=1
while @count<366 --怎么用eof写判断条件。
begin
select @i=平均数 from #s
where 销售日期=@d
update sales_1
set 移动平均数=@i
where 销售日期=@d+3
select @j=销售量 from SALES
where 销售日期=@d+3
set @ot=@j/@i
update sales_1
set 季节性系数=@ot
where 销售日期=@d+3
set @d=@d+1
set @count=@count+1
end