Here is my query (from a trigger):
UPDATE QuoteItemsGroupFeature
SET Cost = (QuoteItemsGroup.BaseCost + QuoteItemsGroup.AccumulatedCost +
ISNULL(SUM(ParentQuoteItemsGroupFeature.Cost), 0)) * INSERTED.Amount
FROM QuoteItemsGroupFeature INNER JOIN INSERTED
ON QuoteItemsGroupFeature.QuoteItemsGroupFeatureId =
INSERTED.QuoteItemsGroupFeatureId
INNER JOIN QuoteItemsGroup ON QuoteItemsGroup.QuoteItemsGroupId =
INSERTED.QuoteItemsGroupId
LEFT OUTER JOIN QuoteItemsGroupFeature ParentQuoteItemsGroupFeature ON
ParentQuoteItemsGroupFeature.QuoteItemsGroupFeatureId =
INSERTED.ParentQuoteItemsGroupFeatureId
GROUP BY QuoteItemsGroup.BaseCost,
QuoteItemsGroup.AccumulatedCost,
INSERTED.Feature,
INSERTED.Cost
It says:
Msg 156, Level 15, State 1, Line 7
Incorrect syntax near the keyword 'GROUP'.