我正在尝试编写带有分组的 sql 查询,但出现错误:-关键字“with”附近的语法不正确。
我正在写的查询如下: -
SELECT CONTRACT,
PACONTNUMBER,
Project Manager ID,
Status,
Project Type,
Project Fee Amount,
Forecast Total Cost,
Forecast Profit,
Forecast %,
Actual Billings,
Actual Total Cost,
Current Actual Profit,
Current %,
GROUPING(PACONTNUMBER) as PACONTNUMBER,
SUM(Project Fee Amount) as Project Fee,
SUM(Forecast Total Cost) as Forecast Cost,
SUM(Forecast Profit) as Forecast Profit,
SUM(Forecast %) as Forecast Percentage,
SUM(Actual Billings) as Billings Total Actual,
SUM(Actual Total Cost) as Total Cost Actual
FROM dbo.vwPAProjects_Summary_New_2
GROUP BY
CONTRACT,
Project Manager ID,
Status,
Project Type,
Project Fee Amount,
Forecast Total Cost,
Forecast Profit,
Forecast %,
Actual Billings,
Actual Total Cost,
Current Actual Profit,
Current %,
PACONTNUMBER with rollup
ORDER BY GROUPING (PACONTNUMBER)
谁能指出我试图让它发挥作用的正确方向?
非常感谢,