Tag: aggregate

按多列分组

我怎么能在LINQ中做GroupBy多列 在SQL中与此类似的东西: SELECT * FROM <TableName> GROUP BY <Column1>,<Column2> 我如何将其转换为LINQ: QuantityBreakdown ( MaterialID int, ProductID int, Quantity float ) INSERT INTO @QuantityBreakdown (MaterialID, ProductID, Quantity) SELECT MaterialID, ProductID, SUM(Quantity) FROM @Transactions GROUP BY MaterialID, ProductID