AVG中的Sql - 浮点数问题

时间:2009-07-09 07:48:25

标签: sql average

SELECT     AVG(variable) AS Expr1, SUM(variable) AS Expr2
FROM       ......

AVG的结果是2,但事实并非如此,它必须是2.95。有什么问题,有什么想法吗?

1 个答案:

答案 0 :(得分:48)

尝试

Select
    AVG(Cast(variable as Float)),
    SUM(variable)
From
    Table