请问如何求一列的乘积老师告诉我用exp(sum(log(列))),可我实验了一下不行啊exp(log(1.1)+log(1.2))=  1.12814414
1.1*1.2=1.32    相差好大啊

解决方案 »

  1.   

    肯定会有偏差,For example:declare @t table(id int,code int)
    insert into @t select  1, 3
    union all      select  2, 4
    union all      select  3, 1
    union all      select  4, 2
    union all      select  5, 4
    union all      select  6,10
    union all      select  7, 5
    union all      select  8, 5declare @multiplier bigint
    set @multiplier=1select @multiplier=@multiplier*code from @tselect @multiplierselect exp(sum(log(code))) from @t