2013-03-05 83 views

回答

3

由于总数只有一个,所以无法计算总和的平均值。

平均值AVG()函数已经计算出总数作为其逻辑的一部分。

这是你想要什么:

SELECT AVG(expenditure) as AverageExpenditure, 
     SUM(expenditure) as TotalExpenditure 
from INCOME; 
+0

非常感谢。有用! – 2013-03-05 02:58:32

2
SELECT AVG(expenditure) AS avg_exp, SUM(expenditure) AS sum_exp FROM INCOME;