`declare @totalItems int,
@totalPeople int,
@averageThings float;
select @totalItems = count(*) from table1
select @totalpeople = count(*) from tblvisits
select @averageThings = cast(@totalItems/@totalPeople as float)
select @averageThings, @totaPeople, @totalItems
这将返回一个整数而不是一个浮点数,我尝试了使用和不使用cast as float
并得到了相同的结果,如何让它返回一个浮点数