declare @S float,@I int
set @I=1
set @S=0
while @I<=100
begin
set @S=@S+1.0/(@I*@I)
set @I=@I+1
end
print @S
;with temp as
(select cast(1 as float) as lvl, cast (0.0000 as float) as num
union all
select lvl+1,1/(lvl*lvl)
from temp
where lvl<=100
)
select sum(num) from temp
---里面是有括号的吧?1/(3*3)?