SELECT
[ProductErpIdentifier],
[PriceValue],
[ManufacturerProductIdentifier],
SUM([QuantityOrdered]) as [QuantityOrdered]
FROM
[eCommerceDev].[dbo].[OrderItem]
GROUP BY
[ProductErpIdentifier],[PriceValue],[ManufacturerProductIdentifier]
ORDER BY
[QuantityOrdered] desc
我應該如何編寫一個CreateCriteria來像上面的例子那樣生成SQL?CreateCriteria對聚合函數總和排序
如果您想運行代碼,我需要知道您的屬性名稱。請發佈您的orderitem實體的映射。 – TedOnTheNet
我正在使用.Add(Projections.Alias(Projections.Sum(「QuantityOrdered」),「QuantityOrdered」) – stefan