3 ms·
same in SQL Server declare @i float =0.37,@times int = 0,@total float = 0 while @times < 5000 begin set @total+= @i set @times +=1 end
by HNDen21 4y ago
same in SQL Server
declare @i float =0.37,@times int = 0,@total float = 0
while @times < 5000
begin
set @total+= @i
set @times +=1
end
select @total
1849.99999999977
or
select sum(t) from(
select top 5000 convert(float, 0.37) t
from sysobjects a cross join sysobjects b) z
1849.99999999977