疯狂的问题......但是,我想要列的表中所有行的总和(不使用 group by 子句)
例子:
Table = Survey
Columns = Answer1, Answer2, Answer3
1 1 1
4 3 5
3 3 2
我想要每列的总和。
最终结果应如下所示:
Answer1Sum Answer2Sum Answer2Sum
8 7 8
这不起作用:
from survey in SurveyAnswers
select new
{
Answer1Sum = survey.Sum(),
Answer2Sum = survey.Sum(),
Answer3Sum = survey.Sum()
}