我需要从下表 PLE 的每个活动中生成一个项目明智的表面积
Activity Posting Date Surface Area Project
---------------------------------------------------------------------
Shearing 01-04-2013 2.34 A
Bending 01-04-2013 2.34 A
Assembly 02-04-2013 2.34 B
PC 02-04-2013 5.34 B
Infill 05-04-2013 5.34 C
我正在尝试这样做。
SELECT DISTINCT Project,sum(Project.[Surface Area]) AS TotalShearing
FROM PLE
WHERE ([Posting Date] BETWEEN @StartDate AND @EndDate)
AND (Activity = Shearing)
GROUP BY Project
现在我想TotalBending, TotalAssembly
在右边的列中显示等等TotalShearing
。但不知道如何获取它们,因为 WHERE 条件已用于活动“剪切”。这可能是一项简单的任务,但我是 SQL 新手,因此需要帮助!